Skip to main content

taggedHash

reddcoinjs-lib v7.0.1-rdd.1Docs


reddcoinjs-lib v7.0.1-rdd.1 / crypto / taggedHash

Function: taggedHash()

taggedHash(prefix, data): Uint8Array

Computes a tagged hash using the specified prefix and data.

Parameters

prefix: "BIP0340/challenge" | "BIP0340/aux" | "BIP0340/nonce" | "TapLeaf" | "TapBranch" | "TapSighash" | "TapTweak" | "KeyAgg list" | "KeyAgg coefficient"

The prefix to use for the tagged hash. This should be one of the values from the TaggedHashPrefix enum.

data: Uint8Array

The data to hash, provided as a Uint8Array.

Returns

Uint8Array

The resulting tagged hash as a Uint8Array.

Defined in

ts_src/crypto.ts:131