diff --git a/lib/src/platform_check/node_crypto.dart b/lib/src/platform_check/node_crypto.dart index b4e9bd57..5f798a87 100644 --- a/lib/src/platform_check/node_crypto.dart +++ b/lib/src/platform_check/node_crypto.dart @@ -12,6 +12,6 @@ external JSObject require(String id); class NodeCrypto { static JSAny randomFillSync(JSAny buf) { final crypto = require('crypto'); - return crypto.callMethod('randomFillSync'.toJS, [buf].toJS); + return crypto.callMethod('randomFillSync'.toJS, buf); } } diff --git a/lib/src/platform_check/web.dart b/lib/src/platform_check/web.dart index 4e49c2af..59ef673f 100644 --- a/lib/src/platform_check/web.dart +++ b/lib/src/platform_check/web.dart @@ -57,7 +57,7 @@ class _JsNodeEntropySource implements EntropySource { @override Uint8List getBytes(int len) { var list = Uint8List(len); - NodeCrypto.randomFillSync(list.toJS); + NodeCrypto.randomFillSync(list.buffer.toJS); return list; } }