jefer94/choco

View on GitHub
packages/password/src/decrypt.ts

Summary

Maintainability
A
0 mins
Test Coverage
import bcrypt from 'bcrypt'

/**
 * Decrypt password.
 * @param password - Password.
 * @param hash - Hash.
 * @returns Is the correct password.
 */
export function decrypt(password: string, hash: string): Promise<boolean> {
  return bcrypt.compare(password, hash)
}