cryptoShorthash static method

Uint8List cryptoShorthash(
  1. Uint8List i,
  2. Uint8List k
)

Implementation

static Uint8List cryptoShorthash(Uint8List i, Uint8List k) {
  RangeError.checkValueInInterval(k.length, cryptoShorthashKeybytes,
      cryptoShorthashKeybytes, 'k', 'Invalid length');

  final _out = calloc<Uint8>(cryptoShorthashBytes);
  final _in = i.toPointer();
  final _k = k.toPointer();
  try {
    _cryptoShorthash
        .crypto_shorthash(_out, _in, i.length, _k)
        .mustSucceed('crypto_shorthash');
    return _out.toList(cryptoShorthashBytes);
  } finally {
    calloc.free(_out);
    calloc.free(_k);
  }
}