Skip to content

Commit

Permalink
Return Uint8Array from Lcg#nextBuffer
Browse files Browse the repository at this point in the history
  • Loading branch information
valadaptive committed Mar 30, 2024
1 parent bd70cce commit 43f26fa
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -319,11 +319,11 @@ class Lcg {
}

nextBuffer (len) {
let arr = [];
let arr = new Uint8Array(len);
for (let i = 0; i < len; i++) {
arr.push(this.nextInt(256));
arr[i] = this.nextInt(256);
}
return Buffer.from(arr);
return arr;
}

choice (arr) {
Expand Down

0 comments on commit 43f26fa

Please sign in to comment.