UNPKG

713 BTypeScriptView Raw
1/**
2 * Calculate the MD5 hash of a message.
3 *
4 * @param message - Message to hash.
5 * @param options - Input and output options.
6 * @returns MD5 hash.
7 */
8declare function md5(message: string | number[] | Uint8Array, options: md5.Options & { asBytes: true }): number[];
9declare function md5(
10 message: string | number[] | Uint8Array,
11 options?: Pick<md5.Options, "asString" | "encoding">,
12): string;
13declare function md5(message: string | number[] | Uint8Array, options?: md5.Options): string | number[];
14
15declare namespace md5 {
16 interface Options {
17 asBytes?: boolean | undefined;
18 asString?: boolean | undefined;
19 encoding?: "binary" | string | undefined;
20 }
21}
22
23export = md5;