diff --git a/JavaScript/index.js b/JavaScript/index.js index 09feea6..2fe4ac5 100644 --- a/JavaScript/index.js +++ b/JavaScript/index.js @@ -39,7 +39,7 @@ class Genid { options.SeqBitLength = SeqBitLength; } // 5.MaxSeqNumber - const MaxSeqNumber = (1 << SeqBitLength) - 1; + const MaxSeqNumber = (1 << options.SeqBitLength) - 1; if (options.MaxSeqNumber <= 0 || options.MaxSeqNumber === undefined) { options.MaxSeqNumber = MaxSeqNumber; } diff --git a/TypeScript/snowflakeIdv1.ts b/TypeScript/snowflakeIdv1.ts index 41198c3..b04e74a 100644 --- a/TypeScript/snowflakeIdv1.ts +++ b/TypeScript/snowflakeIdv1.ts @@ -115,7 +115,7 @@ export class snowflakeIdv1 { // 5.MaxSeqNumber if (options.maxSeqNumber == undefined || options.maxSeqNumber <= 0) - options.maxSeqNumber = (1 << SeqBitLength) - 1 + options.maxSeqNumber = (1 << options.SeqBitLength) - 1 // 6.MinSeqNumber const MinSeqNumber = 5