hash-instance.d.ts 1.0 KB

12345678910111213141516171819202122232425262728293031
  1. import { BaseHash as BaseHasher } from '../base/index';
  2. import { HashInput } from './hash-fn';
  3. import { BrowserEncoding } from './encoding';
  4. import { IBaseHashOptions } from '../base/hash-fn';
  5. import { BrowserHashReader } from './hash-reader';
  6. import { IInternalReader } from '../base/hash-reader';
  7. import { Hash } from './hash';
  8. /**
  9. * @inheritdoc
  10. */
  11. export declare class BrowserHasher extends BaseHasher<Hash, IInternalReader, BrowserHashReader> {
  12. /**
  13. * @inheritdoc
  14. * @override
  15. */
  16. update(data: HashInput): this;
  17. /**
  18. * Returns a digest of the hash with the given encoding.
  19. */
  20. digest(options?: IBaseHashOptions): Hash;
  21. digest(encoding: undefined, options: IBaseHashOptions): Hash;
  22. digest(encoding: BrowserEncoding, options?: IBaseHashOptions): string;
  23. }
  24. /**
  25. * A Node.js crypto-like createHash method.
  26. */
  27. export declare const createHash: () => BrowserHasher;
  28. /**
  29. * A Node.js crypto-like createHash method.
  30. */
  31. export declare const createKeyed: (key: Uint8Array) => BrowserHasher;