baml.random.SystemRandom
A cryptographically secure generator backed by the operating system's entropy source (a CSPRNG). Draws fresh entropy on every call and is not seedable, so it is non-deterministic and suitable for security-sensitive randomness such as keys, tokens, and nonces.
Signature
class baml.random.SystemRandomA cryptographically secure generator backed by the operating system's entropy source (a CSPRNG). Draws fresh entropy on every call and is not seedable, so it is non-deterministic and suitable for security-sensitive randomness such as keys, tokens, and nonces.
Source:<builtin>/baml/ns_random/random.bamlbytes 1926–2358
Static methods
get
() -> baml.random.SystemRandom throws neverReturns a new SystemRandom instance using the global system random number generator.
Implementations
baml.Concrete for T
Source:<builtin>/baml/core.bamlbytes 763–795
baml.random.Rng for baml.random.SystemRandom
Instance methods
random
(self, bytes: int) -> uint8array throws neverrandom_int
(self) -> int throws neverSource:<builtin>/baml/ns_random/random.bamlbytes 2127–2356