• Split secret into the given number of robust shares, threshold number of which can be used with combine() to recover it.

    Identifier is an arbitrary 16 bytes used to describe and identify shares, which will be appended to shares and can be read with readIdentifier().

    The default hash function used to verify correctness of restored secret is SHA-256. To use another function, pass its constructor and identifier. Pass null as hash function to avoid hashing secret.

    Parameters

    • secret: Uint8Array
    • threshold: number
    • totalShares: number
    • identifier: Uint8Array = ...
    • hash: null | (new () => Hash) = SHA256
    • hashId: number = ...
    • Optionalprng: RandomSource

    Returns Uint8Array[]