cryptoPwhashStrNeedsRehash static method

int cryptoPwhashStrNeedsRehash(
  1. Uint8List str,
  2. int opslimit,
  3. int memlimit
)

Implementation

static int cryptoPwhashStrNeedsRehash(
    Uint8List str, int opslimit, int memlimit) {
  RangeError.checkValueInInterval(
      str.length, 1, cryptoPwhashStrbytes, 'str', 'Invalid length');
  RangeError.checkValueInInterval(
      opslimit, cryptoPwhashOpslimitMin, cryptoPwhashOpslimitMax, 'opslimit');
  RangeError.checkValueInInterval(
      memlimit, cryptoPwhashMemlimitMin, cryptoPwhashMemlimitMax, 'memlimit');

  // make sure str is null terminated
  final _str =
      str.toNullTerminatedList(maxLength: cryptoPwhashStrbytes).toPointer();
  try {
    return _cryptoPwhash.crypto_pwhash_str_needs_rehash(
        _str, opslimit, memlimit);
  } finally {
    calloc.free(_str);
  }
}