Skip to content

Commit

Permalink
Merge pull request #2 from oramasearch/fix/switch-to-bigint-from-literal
Browse files Browse the repository at this point in the history
Fix: get rid of literal bigint notation to allow pollyfills for older browsers
  • Loading branch information
matijagaspar authored Oct 18, 2024
2 parents a866cf2 + a7adc3d commit d8c9c9d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ const createEntropy = (length = 4, random = Math.random) => {
* MIT License Copyright (c) 2018 Juan Hernández Serrano
*/
function bufToBigInt(buf) {
let bits = 8n;
let bits = BigInt(8);

let value = 0n;
let value = BigInt(0);
for (const i of buf.values()) {
const bi = BigInt(i);
value = (value << bits) + bi;
Expand Down

0 comments on commit d8c9c9d

Please sign in to comment.