From 9eb2cf09193567a3329b188db6e6f924a8e3347a Mon Sep 17 00:00:00 2001 From: Dmitry Chestnykh Date: Sat, 9 Aug 2014 17:13:26 +0200 Subject: [PATCH] Simplify. --- uniuri.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/uniuri.go b/uniuri.go index 600e640..c2b8ae1 100644 --- a/uniuri.go +++ b/uniuri.go @@ -52,7 +52,7 @@ func NewLenChars(length int, chars []byte) string { if clen > 256 { panic("uniuri: maximum length of charset for NewLenChars is 256") } - maxrb := 256 - (256 % len(chars)) + maxrb := 256 - (256 % clen) i := 0 for { if _, err := io.ReadFull(rand.Reader, r); err != nil {