Skip to content

Commit

Permalink
crypto: fix randomFill with TypedArray buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
arkerone committed Apr 7, 2021
1 parent 038608d commit 77bbef8
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/internal/crypto/random.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,9 @@ function randomFill(buf, offset, size, callback) {
if (typeof offset === 'function') {
callback = offset;
offset = 0;
size = buf.bytesLength;
} else if (typeof size === 'function') {
callback = size;
size = buf.byteLength - offset;
size = undefined;
} else {
validateCallback(callback);
}
Expand Down

0 comments on commit 77bbef8

Please sign in to comment.