native_getentropy function

int native_getentropy(
  1. Pointer<Void> buffer,
  2. int length
)

Write LENGTH bytes of randomness starting at BUFFER. Return 0 on success or -1 on error.

Implementation

int native_getentropy(
  ffi.Pointer<ffi.Void> buffer,
  int length,
) {
  _getentropy ??= Libc().dylib.lookupFunction<
      ffi.Int32 Function(ffi.Pointer<ffi.Void>, ffi.Uint64),
      _dart_getentropy>('getentropy');
  return _getentropy!(
    buffer,
    length,
  );
}