Add function to comparing stored password and actual password

This commit is contained in:
mbaharip
2023-05-25 20:34:18 +07:00
parent d50cb8056c
commit e5dd25205e
@@ -8,9 +8,14 @@ function verify(text: string, hash: string): boolean {
return encode(text) === hash;
}
function compare(hash1: string, hash2: string): boolean {
return hash1 === hash2;
}
const passwordHash = {
encode,
verify,
compare,
};
export default passwordHash;