UNPKG

@kikiutils/node

Version:

A modular utility library for Node.js offering secure hashing, flexible logging, datetime manipulation, and more.

26 lines 1.69 kB
/** * This file provides a set of functions for creating hash digests using different algorithms and bit lengths. * It includes functions for generating SHA-3 hash digests with bit lengths of 224, 256, 384, and 512, * as well as a function for generating MD5 hash digests. * These functions use the Node.js crypto module to generate the hashes. * Can only be used in Node.js/Deno/Bun runtimes. * * @example * ```typescript * import { cryptoSha3256 } from '@kikiutils/node/crypto-hash'; * * console.log(cryptoSha3256('test')); // 36f028580bb02cc8272a9a020f4200e346e276ae664e45ee80745574e2f5ab80 * ``` */ import type { BinaryLike, BinaryToTextEncoding } from 'node:crypto'; export declare function cryptoMd5(data: BinaryLike, outputEncoding?: BinaryToTextEncoding): string; export declare function cryptoMd5ToBuffer(data: BinaryLike): Buffer<ArrayBufferLike>; export declare function cryptoSha3224(data: BinaryLike, outputEncoding?: BinaryToTextEncoding): string; export declare function cryptoSha3224ToBuffer(data: BinaryLike): Buffer<ArrayBufferLike>; export declare function cryptoSha3256(data: BinaryLike, outputEncoding?: BinaryToTextEncoding): string; export declare function cryptoSha3256ToBuffer(data: BinaryLike): Buffer<ArrayBufferLike>; export declare function cryptoSha3384(data: BinaryLike, outputEncoding?: BinaryToTextEncoding): string; export declare function cryptoSha3384ToBuffer(data: BinaryLike): Buffer<ArrayBufferLike>; export declare function cryptoSha3512(data: BinaryLike, outputEncoding?: BinaryToTextEncoding): string; export declare function cryptoSha3512ToBuffer(data: BinaryLike): Buffer<ArrayBufferLike>; //# sourceMappingURL=crypto-hash.d.ts.map