UNPKG

hash-wasm

Version:

Lightning fast hash functions for browsers and Node.js using hand-tuned WebAssembly binaries (MD4, MD5, SHA-1, SHA-2, SHA-3, Keccak, BLAKE2, BLAKE3, PBKDF2, Argon2, bcrypt, scrypt, Adler-32, CRC32, CRC32C, RIPEMD-160, HMAC, xxHash, SM3, Whirlpool)

16 lines (15 loc) 840 B
export type ITypedArray = Uint8Array | Uint16Array | Uint32Array; export type IDataType = string | Buffer | ITypedArray; export type IEmbeddedWasm = { name: string; data: string; hash: string; }; export declare function intArrayToString(arr: Uint8Array, len: number): string; export declare function writeHexToUInt8(buf: Uint8Array, str: string): void; export declare function hexStringEqualsUInt8(str: string, buf: Uint8Array): boolean; export declare function getDigestHex(tmpBuffer: Uint8Array, input: Uint8Array, hashLength: number): string; export declare const getUInt8Buffer: (data: IDataType) => Uint8Array; export declare function encodeBase64(data: Uint8Array, pad?: boolean): string; export declare function getDecodeBase64Length(data: string): number; export declare function decodeBase64(data: string): Uint8Array;