hmac.d.ts 907 B

12345678910111213141516171819202122232425
  1. import type { BytesLike } from "../utils/index.js";
  2. /**
  3. * Return the HMAC for %%data%% using the %%key%% key with the underlying
  4. * %%algo%% used for compression.
  5. *
  6. * @example:
  7. * key = id("some-secret")
  8. *
  9. * // Compute the HMAC
  10. * computeHmac("sha256", key, "0x1337")
  11. * //_result:
  12. *
  13. * // To compute the HMAC of UTF-8 data, the data must be
  14. * // converted to UTF-8 bytes
  15. * computeHmac("sha256", key, toUtf8Bytes("Hello World"))
  16. * //_result:
  17. *
  18. */
  19. export declare function computeHmac(algorithm: "sha256" | "sha512", _key: BytesLike, _data: BytesLike): string;
  20. export declare namespace computeHmac {
  21. var _: (algorithm: "sha256" | "sha512", key: Uint8Array, data: Uint8Array) => BytesLike;
  22. var lock: () => void;
  23. var register: (func: (algorithm: "sha256" | "sha512", key: Uint8Array, data: Uint8Array) => BytesLike) => void;
  24. }
  25. //# sourceMappingURL=hmac.d.ts.map