Skip to content

Commit

Permalink
perf(random): minor update randomBytesFrom()
Browse files Browse the repository at this point in the history
- switch loop direction
  • Loading branch information
postspectacular committed Aug 11, 2023
1 parent a30075a commit 770dbe5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/random/src/random-bytes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const randomBytesFrom = (
start = 0,
end = buf.length
) => {
for (let i = end; --i >= start; ) {
for (let i = start; i < end; i++) {
buf[i] = rnd.int() & 0xff;
}
return buf;
Expand Down

0 comments on commit 770dbe5

Please sign in to comment.