|
@ -8,7 +8,7 @@ import ( |
|
|
// from http://stackoverflow.com/a/31832326
|
|
|
// from http://stackoverflow.com/a/31832326
|
|
|
var src = rand.NewSource(time.Now().UnixNano()) |
|
|
var src = rand.NewSource(time.Now().UnixNano()) |
|
|
|
|
|
|
|
|
const letterBytes = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" |
|
|
|
|
|
|
|
|
const letterBytes = "abcdefghijklmnopqrstuvwxyz1234567890" |
|
|
const ( |
|
|
const ( |
|
|
letterIdxBits = 6 // 6 bits to represent a letter index
|
|
|
letterIdxBits = 6 // 6 bits to represent a letter index
|
|
|
letterIdxMask = 1<<letterIdxBits - 1 // All 1-bits, as many as letterIdxBits
|
|
|
letterIdxMask = 1<<letterIdxBits - 1 // All 1-bits, as many as letterIdxBits
|
|
|