Skip to content

Commit

Permalink
fix wrong conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
konsultaner committed Mar 19, 2024
1 parent 3d25587 commit db68727
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/src/platform_check/node_crypto.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
2 changes: 1 addition & 1 deletion lib/src/platform_check/web.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down

0 comments on commit db68727

Please sign in to comment.