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