|
|
@ -44,7 +44,10 @@ func CRandBytes(numBytes int) []byte { |
|
|
|
return b |
|
|
|
} |
|
|
|
|
|
|
|
// RandHex(24) gives 96 bits of randomness, strong enough for most purposes.
|
|
|
|
// CRandHex returns a hex encoded string that's floor(numDigits/2) * 2 long.
|
|
|
|
//
|
|
|
|
// Note: CRandHex(24) gives 96 bits of randomness that
|
|
|
|
// are usually strong enough for most purposes.
|
|
|
|
func CRandHex(numDigits int) string { |
|
|
|
return hex.EncodeToString(CRandBytes(numDigits / 2)) |
|
|
|
} |
|
|
|