Merge pull request #9 from argusdusty/patch-1
Correct for bias towards first character in chars
This commit is contained in:
commit
d7c89a5f19
1 changed files with 1 additions and 1 deletions
|
|
@ -57,7 +57,7 @@ func NewLenChars(length int, chars []byte) string {
|
|||
if clen > 256 {
|
||||
panic("uniuri: maximum length of charset for NewLenChars is 256")
|
||||
}
|
||||
maxrb := 256 - (256 % clen)
|
||||
maxrb := 255 - (256 % clen)
|
||||
b := make([]byte, length)
|
||||
r := make([]byte, length+(length/4)) // storage for random bytes.
|
||||
i := 0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue