UNPKG

780 BTypeScriptView Raw
1import { ValidationOptions } from '../ValidationOptions';
2import ValidatorJS from 'validator';
3export declare const IS_HASH = "isHash";
4/**
5 * Check if the string is a hash of type algorithm.
6 * Algorithm is one of ['md4', 'md5', 'sha1', 'sha256', 'sha384', 'sha512', 'ripemd128', 'ripemd160', 'tiger128',
7 * 'tiger160', 'tiger192', 'crc32', 'crc32b']
8 */
9export declare function isHash(value: unknown, algorithm: ValidatorJS.HashAlgorithm): boolean;
10/**
11 * Check if the string is a hash of type algorithm.
12 * Algorithm is one of ['md4', 'md5', 'sha1', 'sha256', 'sha384', 'sha512', 'ripemd128', 'ripemd160', 'tiger128',
13 * 'tiger160', 'tiger192', 'crc32', 'crc32b']
14 */
15export declare function IsHash(algorithm: string, validationOptions?: ValidationOptions): PropertyDecorator;