We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7535b91 commit 0eed61bCopy full SHA for 0eed61b
hasher.ts
@@ -33,7 +33,10 @@ export class Hasher {
33
static generate(
34
bits?: number,
35
): HasherOptions {
36
- bits = bits ?? Number.MAX_SAFE_INTEGER.toString(2).length;
+ bits = bits ?? Number.MAX_SAFE_INTEGER.toString(2).length; // default to Number.MAX_SAFE_INTEGER
37
+ if (bits < 2) {
38
+ throw new Error("bits must be greater than 2");
39
+ }
40
const modBase = 2n ** BigInt(bits);
41
const prime = randomPrime(bits);
42
return {
0 commit comments