Polkadot Apps
    Preparing search index...

    Re-export the full HKDF function from @noble/hashes for advanced use cases that need custom hash functions or output lengths.

    • HKDF-extract from spec. Less important part. HKDF-Extract(IKM, salt) -> PRK Arguments position differs from spec (IKM is first one, since it is not optional) Local validation only checks hash; ikm / salt byte validation is delegated to hmac().

      Parameters

      • hash: TArg<CHash>

        hash function that would be used (e.g. sha256)

      • ikm: TArg<Uint8Array<ArrayBufferLike>>

        input keying material, the initial key

      • Optionalsalt: TArg<Uint8Array<ArrayBufferLike>>

        optional salt value (a non-secret random value)

      Returns Uint8Array<ArrayBufferLike> & Uint8Array<ArrayBuffer>

      Pseudorandom key derived from input keying material.

      Run the HKDF extract step.

      import { extract } from '@noble/hashes/hkdf.js';
      import { sha256 } from '@noble/hashes/sha2.js';
      extract(sha256, new Uint8Array([1, 2, 3]), new Uint8Array([4, 5, 6]));