README
¶
randutil
Helper library for cryptographic and mathmatical randoms
Community
Pion has an active community on the Golang Slack. Sign up and join the #pion channel for discussions and support. You can also use Pion mailing list.
We are always looking to support your projects. Please reach out if you have something to build!
If you need commercial support or don't want to use public methods you can contact us at team@pion.ly
Contributing
Check out the contributing wiki to join the group of amazing people making this project possible:
- Atsushi Watanabe - Original Author
Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CryptoUint64 ¶ added in v0.1.0
CryptoUint64 returns cryptographic random uint64.
Types ¶
type MathRandomGenerator ¶
type MathRandomGenerator interface { // Intn returns random integer within [0:n). Intn(n int) int // Uint32 returns random 32-bit unsigned integer. Uint32() uint32 // Uint64 returns random 64-bit unsigned integer. Uint64() uint64 // GenerateString returns ranom string using given set of runes. // It can be used for generating unique ID to avoid name collision. // // Caution: DO NOT use this for cryptographic usage. GenerateString(n int, runes string) string }
MathRandomGenerator is a random generator for non-crypto usage.
func NewMathRandomGenerator ¶
func NewMathRandomGenerator() MathRandomGenerator
NewMathRandomGenerator creates new mathmatical random generator. Random generator is seeded by crypto random.