ReadonlynameAlways "RandError"; the cross-copy identity RandError.isRandError checks.
ReadonlycodeThe discriminant; equals details.code.
ReadonlydetailsThe structured payload, discriminated by code.
StaticisType guard for a RandError, including one from another copy of this package.
Staticinvalidparameter is not an integer in [bounds.min, bounds.max]; value is what was received.
Staticinvalidparameter is not a Uint8Array; value is what was received.
Staticemptystart >= end for a half-open range, or start > end for a closed one.
StaticrangeA signed range's end - start exceeds the width's MAX ([0, MAX] for a
closed range, [1, MAX] for a half-open one), where the reference's
arithmetic overflows.
StaticvalueThe full-width early return's raw 64-bit draw does not fit the target width.
Staticinvalidparameter is not expected (a seed shape, a seed word, or a byte length).
StaticinvalidThe generator has no callable method; value is the member found, or
the undefined/null generator itself. Public so that a consumer calling
a member this package does not (fillBytesPacked) reports the same error.
Staticinvalidmethod returned value, which is outside its contract: nextU64 must
return a bigint in [0, 2^64 - 1]; nextU32 and nextU64Low32 an
integer in [0, 2^32 - 1].
StaticcryptoNo Web Crypto API (globalThis.crypto) in this environment.
Thrown for an argument outside its width, an empty or over-long range, a full-width draw that does not fit, a malformed seed or state, a generator that breaks the contract, and a missing Web Crypto API. Branch on
code; the messages are the port's own (the reference panics with compiler andcorestrings).Instances come from the static factories only.
Example