before adding cryptoshuffler
This commit is contained in:
@@ -71,14 +71,23 @@ func (o *GenOpts) generatePassword(c CharSet) (password string, err error) {
|
||||
// And make the rune slice of that length.
|
||||
passAlloc = make([]rune, passLen)
|
||||
|
||||
for _, idx := range passAlloc {
|
||||
for idx, _ := range passAlloc {
|
||||
var char Char
|
||||
|
||||
if char, err = c.RandChar(); err != nil {
|
||||
return
|
||||
}
|
||||
for {
|
||||
var isDisabled bool
|
||||
|
||||
passAlloc[idx] = rune(char)
|
||||
if char, err = c.RandChar(); err != nil {
|
||||
return
|
||||
}
|
||||
if isDisabled, err = o.DisabledChars.Has(char); err != nil || isDisabled {
|
||||
err = nil
|
||||
continue
|
||||
}
|
||||
|
||||
passAlloc[idx] = rune(char)
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
password = string(passAlloc)
|
||||
|
||||
Reference in New Issue
Block a user