Skip to content

Commit

Permalink
fix(bson): initial random value of incremental counter of ObjectId
Browse files Browse the repository at this point in the history
  • Loading branch information
marcj committed Nov 21, 2024
1 parent ec38493 commit fb1263d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/bson/src/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ for (let i = 0; i < 256; i++) {
* in types like t.any.
*/
export class ObjectId {
static index: number = Math.ceil(Math.random() & 0xffffff);
static index: number = Math.ceil(Math.random() * 0xffffff);

static generate(time?: number): string {
if (!time) time = Math.ceil(Date.now() / 1000);
Expand Down

0 comments on commit fb1263d

Please sign in to comment.