Skip to content

Commit

Permalink
fix(default): maximize buffer cache
Browse files Browse the repository at this point in the history
  • Loading branch information
lukeed committed Oct 29, 2020
1 parent c08dd99 commit 00b528b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ while (IDX--) HEX[IDX] = (IDX + 256).toString(16).substring(1);

export function uid(len) {
var i=0, tmp=(len || 11);
if (!BUFFER || ((IDX + tmp) > SIZE)) {
if (!BUFFER || ((IDX + tmp) > SIZE*2)) {
for (BUFFER='',IDX=0; i < SIZE; i++) {
BUFFER += HEX[Math.random() * 256 | 0];
}
Expand Down

0 comments on commit 00b528b

Please sign in to comment.