1
0
Fork 0
mirror of https://github.com/nishiki/manage-password.git synced 2025-02-20 01:50:04 +00:00

fix password generator

This commit is contained in:
Adrien Waksberg 2017-05-20 12:03:57 +02:00
parent 01831c1f2b
commit 811c576aae

View file

@ -301,11 +301,9 @@ module MPW
chars = [*('A'..'Z'), *('a'..'z'), *('0'..'9')] if chars.empty?
result = ''
while length > 62
result << chars.sample(62).join
length -= 62
length.times do
result << chars.sample
end
result << chars.sample(length).join
result
end