mirror of
https://github.com/SinTan1729/chhoto-url
synced 2024-12-26 07:38:36 -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 rightLimit = 122; // letter 'z'
|
||||||
int targetStringLength = 10;
|
int targetStringLength = 10;
|
||||||
|
|
||||||
String generatedString = random.ints(leftLimit, rightLimit + 1)
|
return random.ints(leftLimit, rightLimit + 1)
|
||||||
.filter(i -> (i <= 57 || i >= 65) && (i <= 90 || i >= 97))
|
.filter(i -> (i <= 57 || i >= 97))
|
||||||
.limit(targetStringLength)
|
.limit(targetStringLength)
|
||||||
.collect(StringBuilder::new,
|
.collect(StringBuilder::new,
|
||||||
StringBuilder::appendCodePoint,
|
StringBuilder::appendCodePoint,
|
||||||
StringBuilder::append)
|
StringBuilder::append)
|
||||||
.toString();
|
.toString();
|
||||||
|
|
||||||
return generatedString;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue