mirror of
https://github.com/minoplhy/chhoto-url.git
synced 2024-11-23 01:26:46 +00:00
Now only lowercase letters and numbers are generated
This commit is contained in:
parent
bde40b61e6
commit
8cd399d2e9
@ -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 New Issue
Block a user