blake3_js.d.ts 933 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /* tslint:disable */
  2. /* eslint-disable */
  3. /**
  4. * @param {Uint8Array} data
  5. * @param {Uint8Array} out
  6. */
  7. export function hash(data: Uint8Array, out: Uint8Array): void;
  8. /**
  9. * @returns {Blake3Hash}
  10. */
  11. export function create_hasher(): Blake3Hash;
  12. /**
  13. * @param {Uint8Array} key_slice
  14. * @returns {Blake3Hash}
  15. */
  16. export function create_keyed(key_slice: Uint8Array): Blake3Hash;
  17. /**
  18. * @param {string} context
  19. * @returns {Blake3Hash}
  20. */
  21. export function create_derive(context: string): Blake3Hash;
  22. /**
  23. */
  24. export class Blake3Hash {
  25. free(): void;
  26. /**
  27. * @returns {HashReader}
  28. */
  29. reader(): HashReader;
  30. /**
  31. * @param {Uint8Array} input_bytes
  32. */
  33. update(input_bytes: Uint8Array): void;
  34. /**
  35. * @param {Uint8Array} out
  36. */
  37. digest(out: Uint8Array): void;
  38. }
  39. /**
  40. */
  41. export class HashReader {
  42. free(): void;
  43. /**
  44. * @param {Uint8Array} bytes
  45. */
  46. fill(bytes: Uint8Array): void;
  47. /**
  48. * @param {BigInt} position
  49. */
  50. set_position(position: BigInt): void;
  51. }