UNPKG

hashion

Version:
32 lines (25 loc) 705 B
declare type HashCallback = (e: any, data: HashCallbackData) => void; declare type HashCallbackData = { progress: number; hash?: string; time?: number; }; declare type HashParameters = { file: File; chunkSize: number; }; export declare class Sha { static pluginName: string; static name: string; algorithm: ShaAlgorithm; name: string; constructor(options: ShaOptions); computeHash(data: HashParameters, callback: HashCallback): { abort: () => void; }; } export declare type ShaAlgorithm = 'SHA-1' | 'SHA-256' | 'SHA-384' | 'SHA-512'; export declare type ShaOptions = { algorithm: ShaAlgorithm; }; export { }