check method

bool check({
  1. required String plain,
  2. required String hashed,
  3. String? iv,
})

Check if plaintext matches previously hashed text

Implementation

bool check({required String plain, required String hashed, String? iv}) {
  if (_type == MacType.Poly1305) {
    return _mac.check(utf8.encode(plain), base64.decode(hashed), iv: iv)
        as bool;
  }
  return _mac.check(utf8.encode(plain), base64.decode(hashed)) as bool;
}