UNPKG

@n3okill/utils

Version:
10 lines (9 loc) 425 B
/** * Prefixes data with a keyed hash value so that it can later be detected if it is tampered. * @param data Data to be protected * @param key Secret key to be used for generating hash * @param algorithm Hashing algorithm (e.g. "md5", "sha1", "sha256", etc.) * @return Data prefixed with the keyed hash * @see validateData() */ export declare function hashData(data: string, key: string, algorithm?: string): string;