verify static method

bool verify(
  1. String password,
  2. String hashedPassword
)

verify the password with input password and stored hash string. Returns false when the hash is not a valid bcrypt hash.

Hash.verify('secret', '<hashedString>');

Implementation

static bool verify(String password, String hashedPassword) {
  try {
    return BCrypt.checkpw(password, hashedPassword);
  } catch (_) {
    return false;
  }
}