mirror of
https://github.com/tendermint/tendermint.git
synced 2025-12-23 14:25:19 +00:00
16 lines
218 B
Go
16 lines
218 B
Go
package crypto
|
|
|
|
import (
|
|
"crypto/rand"
|
|
)
|
|
|
|
// This only uses the OS's randomness
|
|
func CRandBytes(numBytes int) []byte {
|
|
b := make([]byte, numBytes)
|
|
_, err := rand.Read(b)
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
return b
|
|
}
|