Expand description
§Blockchain Commons Random Number Utilities
bc-rand exposes a uniform API for the random number primitives used
in higher-level Blockchain Commons
projects, including a cryptographically strong random number generator
SecureRandomNumberGenerator and a deterministic random number generator
SeededRandomNumberGenerator.
These primitive random number generators implement the
RandomNumberGenerator trait to produce random numbers compatible with
the RandomNumberGenerator Swift protocol used in MacOS and iOS, which is
important when using the deterministic random number generator for
cross-platform testing.
The crate also includes several convenience functions for generating secure and deterministic random numbers.
Structs§
- A random number generator that can be used as a source of cryptographically-strong randomness.
- A random number generator that can be used as a source of deterministic pseudo-randomness for testing purposes.
Traits§
- A type that can generate random numbers.
Functions§
- Creates a vector of random data with a fixed seed.
- Fill the given slice with cryptographically strong random bytes.
- Creates a seeded random number generator with a fixed seed.
- Generate a vector of cryptographically strong random bytes of the given size.