jeudi 30 juin 2016

RandomStringUtils.random strange behavior in web application

I am generation a random password with RandomStringUtils.random. It seems to has a strange behavior when generate the password while the application is running, it always create a password with this structure: [C@1c3f05e5, [C@2b15e4de, [C@18c628b6. It always repeat the three first characters. My code to generate the password is:

char[] password = RandomStringUtils.random(10, 0, 0, true, true, null, 
                new SecureRandom()).toCharArray();

If I execute this code in a main method, it seems work well.




Aucun commentaire:

Enregistrer un commentaire