Browse Source

Merge pull request #54 from tendermint/cRandHex-doc-fix

CRandHex: fix up doc to mention length of digits
pull/1782/head
Ethan Buchman 7 years ago
committed by GitHub
parent
commit
4041adbf92
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions
  1. +4
    -1
      random.go

+ 4
- 1
random.go View File

@ -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))
}


Loading…
Cancel
Save