@blockchaincommons/rand - v1.0.0-beta.3
    Preparing search index...

    Type Alias RandErrorCode

    RandErrorCode:
        | "InvalidArgument"
        | "EmptyRange"
        | "RangeTooLong"
        | "ValueDoesNotFit"
        | "InvalidSeed"
        | "InvalidGenerator"
        | "CryptoUnavailable"

    Machine-readable discriminant for a RandError.

    Type Declaration

    • "InvalidArgument"

      An argument is not an integer inside its width, or dest is not a Uint8Array.

    • "EmptyRange"

      start >= end (half-open) or start > end (closed): the reference's assert!.

    • "RangeTooLong"

      A signed range longer than its width's MAX: the reference's overflow of end - start.

    • "ValueDoesNotFit"

      The full-width early return drew a value the narrower width cannot hold: the reference's unwrap().

    • "InvalidSeed"

      A seed or state that is not four u64 words or exactly 32 bytes.

    • "InvalidGenerator"

      A generator that breaks the RandomNumberGenerator contract.

    • "CryptoUnavailable"

      No Web Crypto API in this environment: the reference's "Failed to seed RNG".