token is now an writable char thanks to the modulos !
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m3s
Build and test backend / Test-backend (pull_request) Successful in 1m57s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 22s

This commit is contained in:
Bartha Maxime 2024-03-09 00:46:40 +01:00
parent 82a3b152f2
commit 521c98fdc2

View File

@ -25,11 +25,7 @@ public class TokenService {
byte[] bytes = new byte[64]; byte[] bytes = new byte[64];
new SecureRandom().nextBytes(bytes); new SecureRandom().nextBytes(bytes);
for (int i = 0; i < bytes.length; i++) { for (int i = 0; i < bytes.length; i++) {
while (bytes[i] == 0){ bytes[i] = (byte) (((bytes[i]+256)%256 %95+ 32));
byte[] temp = new byte[1];
new SecureRandom().nextBytes(temp);
bytes[i] = temp[0];
}
} }
// will never end up in the catch because of the way that SecureRandom.nextBytes is implemented // will never end up in the catch because of the way that SecureRandom.nextBytes is implemented
try { try {