I'm currently use this following code to generate a 10-character random string[A-Z a-z 0-9]
random_code = [*('a'..'z'),*('0'..'9'),*('A'..'Z')].shuffle[0, 10].join
However, sometimes this random string does not contain a number or an uppercase character. Could you help me to have a better method that generates a random string that requires at least 1 number, 1 uppercase and 1 downcase character?
Aucun commentaire:
Enregistrer un commentaire