hash-fn.d.ts 1.0 KB

123456789101112131415161718192021
  1. /// <reference types="node" />
  2. import { HashInput } from '../node/hash-fn';
  3. import { IBaseHashOptions } from '../base/hash-fn';
  4. /**
  5. * @hidden
  6. */
  7. export declare const normalizeInput: (input: HashInput, encoding?: "ascii" | "utf8" | "utf-8" | "utf16le" | "ucs2" | "ucs-2" | "base64" | "latin1" | "binary" | "hex" | undefined) => Buffer;
  8. /**
  9. * Returns a blake3 hash of the input, returning the binary hash data.
  10. */
  11. export declare function hash(input: HashInput, { length }?: IBaseHashOptions): Buffer | string;
  12. /**
  13. * Given cryptographic key material and a context string, services a subkey of
  14. * any length. See {@link https://docs.rs/blake3/0.1.3/blake3/fn.derive_key.html}
  15. * for more information.
  16. */
  17. export declare function deriveKey(context: string, material: HashInput, { length }?: IBaseHashOptions): Buffer;
  18. /**
  19. * The keyed hash function. See {@link https://docs.rs/blake3/0.1.3/blake3/fn.keyed_hash.html}.
  20. */
  21. export declare function keyedHash(key: Buffer, input: HashInput, { length }?: IBaseHashOptions): Buffer;