Skip to content

Commit 65936c9

Browse files
committed
test: remove redundant checks for UUID version and variant bits
1 parent 343f7f0 commit 65936c9

File tree

1 file changed

+0
-7
lines changed

1 file changed

+0
-7
lines changed

test/parallel/test-crypto-randomuuidv7.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ const {
1010
randomUUIDv7,
1111
} = require('crypto');
1212

13-
// Basic return type and format checks.
1413
{
1514
const uuid = randomUUIDv7();
1615
assert.strictEqual(typeof uuid, 'string');
@@ -23,22 +22,18 @@ const {
2322
);
2423
}
2524

26-
// Check version and variant bits.
2725
{
2826
const uuid = randomUUIDv7();
2927

30-
// Version 7: byte 6 high nibble should be 0x7.
3128
assert.strictEqual(
3229
Buffer.from(uuid.slice(14, 16), 'hex')[0] & 0xf0, 0x70,
3330
);
3431

35-
// Variant: byte 8 high 2 bits should be 0b10.
3632
assert.strictEqual(
3733
Buffer.from(uuid.slice(19, 21), 'hex')[0] & 0b1100_0000, 0b1000_0000,
3834
);
3935
}
4036

41-
// Uniqueness: generate many UUIDs and verify no duplicates.
4237
{
4338
const seen = new Set();
4439
for (let i = 0; i < 1000; i++) {
@@ -64,8 +59,6 @@ const {
6459
assert(timestamp <= after, `Timestamp ${timestamp} > after ${after}`);
6560
}
6661

67-
// Monotonicity: UUIDs generated in sequence should sort lexicographically
68-
// within the same millisecond or across milliseconds.
6962
{
7063
let prev = randomUUIDv7();
7164
for (let i = 0; i < 100; i++) {

0 commit comments

Comments
 (0)