Function hash160

  • Hash the given payload with sha256, then hash the 32-byte result with ripemd160, returning a 20-byte hash.

    This hash is used in both AddressType.p2pkh and AddressType.p2sh20 addresses.

    Parameters

    • payload: Uint8Array

      the Uint8Array to hash

    • crypto: {
          ripemd160: {
              hash: ((input: Uint8Array) => Uint8Array);
          };
          sha256: {
              hash: ((input: Uint8Array) => Uint8Array);
          };
      } = ...
      • ripemd160: {
            hash: ((input: Uint8Array) => Uint8Array);
        }
        • hash: ((input: Uint8Array) => Uint8Array)
            • (input: Uint8Array): Uint8Array
            • Returns the ripemd160 hash of the provided input.

              To incrementally construct a ripemd160 hash (e.g. for streaming), use init, update, and final.

              Parameters

              • input: Uint8Array

                a Uint8Array to be hashed using ripemd160

              Returns Uint8Array

      • sha256: {
            hash: ((input: Uint8Array) => Uint8Array);
        }
        • hash: ((input: Uint8Array) => Uint8Array)
            • (input: Uint8Array): Uint8Array
            • Returns the sha256 hash of the provided input.

              To incrementally construct a sha256 hash (e.g. for streaming), use init, update, and final.

              Parameters

              • input: Uint8Array

                a Uint8Array to be hashed using sha256

              Returns Uint8Array

    Returns Uint8Array

Generated using TypeDoc