verifyStorage static method

bool verifyStorage(
  1. String storage,
  2. String password
)

Verifies that the storage is a valid password verification string for given password.

Implementation

static bool verifyStorage(String storage, String password) {
  final str = ascii.encode(storage);
  final passwd = utf8.encoder.convert(password);

  return Sodium.cryptoPwhashStrVerify(str, passwd) == 0;
}