verifyAsync static method

Future<bool> verifyAsync(
  1. String password,
  2. String hashedPassword
)

same as verify, but runs bcrypt in a new isolate, so the server can answer other requests in the meantime.

bool ok = await Hash.verifyAsync('secret', '<hashedString>');

Implementation

static Future<bool> verifyAsync(String password, String hashedPassword) {
  return Isolate.run(() => verify(password, hashedPassword));
}