|
@@ -78,7 +78,7 @@ func randomBytesMod(length int, mod byte) (b []byte) {
|
|
|
for {
|
|
for {
|
|
|
r := randomBytes(length + (length / 4))
|
|
r := randomBytes(length + (length / 4))
|
|
|
for _, c := range r {
|
|
for _, c := range r {
|
|
|
- if c >= maxrb {
|
|
|
|
|
|
|
+ if c > maxrb {
|
|
|
// Skip this number to avoid modulo bias.
|
|
// Skip this number to avoid modulo bias.
|
|
|
continue
|
|
continue
|
|
|
}
|
|
}
|
|
@@ -89,7 +89,6 @@ func randomBytesMod(length int, mod byte) (b []byte) {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- panic("unreachable")
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// randomId returns a new random id string.
|
|
// randomId returns a new random id string.
|