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

    Class ShamirError

    Thrown for invalid split parameters, malformed share sets, a failed recovery checksum, and (JS-only) an argument outside its domain: a threshold, shareCount or share index that is not a usize, or an argument of the wrong type. Branch on code; messages are the reference's strings.

    Instances come from the static factories only.

    try {
    recoverSecret(shares);
    } catch (e) {
    if (ShamirError.isShamirError(e) && e.is("ChecksumFailure")) {
    // wrong, missing or altered shares
    }
    }

    Hierarchy

    • Error
      • ShamirError
    Index
    name: "ShamirError"

    Always "ShamirError"; the cross-copy identity ShamirError.isShamirError checks.

    The discriminant; equals details.code.

    The structured payload, discriminated by code.

    • Type guard for a ShamirError, including one from another copy of this package.

      Parameters

      • value: unknown

      Returns value is ShamirError

    • parameter is outside its domain: an integer parameter that is not a usize (neither a safe non-negative integer number nor a bigint in [0, 2^64 - 1]), or an argument of the wrong type. value is what was received; the message renders it exactly.

      Parameters

      Returns ShamirError