@utilify/core
Version:
Modern, strongly typed, and safe utility function library for JavaScript and TypeScript. Includes type checking, manipulation of arrays, objects, strings, dates, colors, numbers, regular expressions, and more. Compatible with Browser, Node.js, Deno, and B
11 lines • 525 B
TypeScript
type HashAlgorithm = 'SHA-1' | 'SHA-256' | 'SHA-384' | 'SHA-512';
/**
* Checks if a string is a valid hash for the given algorithm.
* @param {string} hash - The hash string to check.
* @param {HashAlgorithm} [algorithm='SHA-256'] - The hash algorithm.
* @returns {boolean} True if valid hash, false otherwise.
* @throws {TypeError|Error} If hash is not a string or algorithm is invalid.
*/
export default function isHash(hash: string, algorithm?: HashAlgorithm): boolean;
export {};
//# sourceMappingURL=isHash.d.ts.map