Import std.crypto.random
SecureRandom
struct
Public Struct SecureRandom
Random bytes and numbers from the OS's randomness, for keys, tokens, and other secrets.
Examples
Local token = SecureRandom.Bytes(16)
Expect(token.Count == 16)
Local roll = SecureRandom.Below(6)
Expect(roll >= 0 && roll < 6)-
countrandom bytes. Panics whencountis negative. -
A random number from 0 up to
limit, withoutlimit, each as likely as another. Panics unlesslimitis above 0.
Report an issue with this page or with FutureBlitz on GitHub.