cryptoGenerichashFinal static method

Uint8List cryptoGenerichashFinal(
  1. Pointer<Uint8> state,
  2. int outlen
)

Implementation

static Uint8List cryptoGenerichashFinal(Pointer<Uint8> state, int outlen) {
  RangeError.checkValueInInterval(
      outlen, cryptoGenerichashBytesMin, cryptoGenerichashBytesMax);

  final _out = calloc<Uint8>(outlen);

  try {
    _cryptoGenerichash
        .crypto_generichash_final(state, _out, outlen)
        .mustSucceed('crypto_generichash_final');
    return _out.toList(outlen);
  } finally {
    // note: caller is responsible for freeing state
    calloc.free(_out);
  }
}