UNPKG

hash-wasm-rs

Version:

A WebAssembly library for computing file hashes, built with Rust.

46 lines (45 loc) 1.23 kB
/* tslint:disable */ /* eslint-disable */ export function get_file_uint8array_and_blob(file: File): Promise<GetFileResult>; export function get_data_as_bytes(data: any): Promise<Uint8Array>; export function blake3(data: any): Promise<HashResult>; export function md5(data: any): Promise<HashResult>; export function sha3_256(data: any): Promise<HashResult>; export function sha3_512(data: any): Promise<HashResult>; export function sha_256(data: any): Promise<HashResult>; export function sha2_512(data: any): Promise<HashResult>; export enum HashType { MD5 = 0, BLAKE3 = 1, SHA224 = 2, SHA256 = 3, SHA384 = 4, SHA512 = 5, SHA3_224 = 6, SHA3_256 = 7, SHA3_384 = 8, SHA3_512 = 9, } export class GetFileResult { private constructor(); free(): void; } export class HashResult { private constructor(); free(): void; readonly hex: string; readonly bytes: Uint8Array; } export class HasherWrapper { free(): void; constructor(hash_type: HashType, input: any); update(): Promise<void>; finalize(): Uint8Array; result(): Promise<HashResult>; } export class HasherWrapperConfig { free(): void; constructor(hash_type: HashType, chunk_size: number); hash_type: HashType; chunk_size: number; }