class-validator
Version:
Decorator-based property validation for classes.
16 lines (15 loc) • 785 B
TypeScript
import { ValidationOptions } from '../ValidationOptions';
import * as ValidatorJS from 'validator';
export declare const IS_HASH = "isHash";
/**
* Check if the string is a hash of type algorithm.
* Algorithm is one of ['md4', 'md5', 'sha1', 'sha256', 'sha384', 'sha512', 'ripemd128', 'ripemd160', 'tiger128',
* 'tiger160', 'tiger192', 'crc32', 'crc32b']
*/
export declare function isHash(value: unknown, algorithm: ValidatorJS.HashAlgorithm): boolean;
/**
* Check if the string is a hash of type algorithm.
* Algorithm is one of ['md4', 'md5', 'sha1', 'sha256', 'sha384', 'sha512', 'ripemd128', 'ripemd160', 'tiger128',
* 'tiger160', 'tiger192', 'crc32', 'crc32b']
*/
export declare function IsHash(algorithm: string, validationOptions?: ValidationOptions): PropertyDecorator;