verifyAsync static method

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

same as verify, but runs bcrypt on a worker isolate of Dox().compute, so the server can answer other requests in the meantime. Use it in the web server. It works without a server too.

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

Implementation

static Future<bool> verifyAsync(String password, String hashedPassword) {
  return ComputePool.instance.run(() => _verify(password, hashedPassword));
}