token is now an writable char thanks to the modulos !
This commit is contained in:
parent
82a3b152f2
commit
521c98fdc2
@ -25,11 +25,7 @@ public class TokenService {
|
||||
byte[] bytes = new byte[64];
|
||||
new SecureRandom().nextBytes(bytes);
|
||||
for (int i = 0; i < bytes.length; i++) {
|
||||
while (bytes[i] == 0){
|
||||
byte[] temp = new byte[1];
|
||||
new SecureRandom().nextBytes(temp);
|
||||
bytes[i] = temp[0];
|
||||
}
|
||||
bytes[i] = (byte) (((bytes[i]+256)%256 %95+ 32));
|
||||
}
|
||||
// will never end up in the catch because of the way that SecureRandom.nextBytes is implemented
|
||||
try {
|
||||
|
Loading…
Reference in New Issue
Block a user