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:
parent
01831c1f2b
commit
811c576aae
1 changed files with 2 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue