mirror of
https://github.com/SinTan1729/chhoto-url
synced 2024-12-25 23:28:37 -06:00
Now only lowercase letters and numbers are generated
This commit is contained in:
parent
bde40b61e6
commit
8cd399d2e9
1 changed files with 2 additions and 4 deletions
|
@ -10,14 +10,12 @@ public class Utils {
|
|||
int rightLimit = 122; // letter 'z'
|
||||
int targetStringLength = 10;
|
||||
|
||||
String generatedString = random.ints(leftLimit, rightLimit + 1)
|
||||
.filter(i -> (i <= 57 || i >= 65) && (i <= 90 || i >= 97))
|
||||
return random.ints(leftLimit, rightLimit + 1)
|
||||
.filter(i -> (i <= 57 || i >= 97))
|
||||
.limit(targetStringLength)
|
||||
.collect(StringBuilder::new,
|
||||
StringBuilder::appendCodePoint,
|
||||
StringBuilder::append)
|
||||
.toString();
|
||||
|
||||
return generatedString;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue