We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent aa2e6ee commit 0d82bf2Copy full SHA for 0d82bf2
src/index.js
@@ -61,7 +61,12 @@
61
// Generate a new custom ObjectId
62
const timestampHex = Math.floor(Date.now() / 1000).toString(16).padStart(8, '0');
63
const processIdHex = Math.floor(Math.random() * 0x100000000000).toString(16).padStart(12, '0');
64
+
65
counter = (counter + 1) % 10000;
66
+ if (counter < 2) {
67
+ counter = Math.floor(Math.random() * (5000 - 100 + 1)) + 100;
68
+ }
69
70
const counterHex = counter.toString(16).padStart(4, '0');
71
72
// Return the custom ObjectId object with a toString() method
0 commit comments