← index

[Crypto]Randomabstract

inherits Object

Bytes from the operating system's CSPRNG — for keys, tokens, and salts. The seedable Random class is for simulations and tests; this one is for secrets (and is deliberately not seedable).

([Crypto]Random.bytes:16).count     "* -> 16

Class methods

bytes:

N bytes from the OS CSPRNG.

([Crypto]Random.bytes:32).count     "* -> 32

native