%PDF- <> %âãÏÓ endobj 2 0 obj <> endobj 3 0 obj <>/ExtGState<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI] >>/Annots[ 28 0 R 29 0 R] /MediaBox[ 0 0 595.5 842.25] /Contents 4 0 R/Group<>/Tabs/S>> endobj ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<> endobj 2 0 obj<>endobj 2 0 obj<>es 3 0 R>> endobj 2 0 obj<> ox[ 0.000000 0.000000 609.600000 935.600000]/Fi endobj 3 0 obj<> endobj 7 1 obj<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI]>>/Subtype/Form>> stream
'use strict'; const common = require('../common'); if (!common.hasCrypto) common.skip('missing crypto'); const assert = require('assert'); const { randomUUID, } = require('crypto'); const last = new Set([ '00000000-0000-0000-0000-000000000000', ]); function testMatch(uuid) { assert.match( uuid, /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/); } // Generate a number of UUID's to make sure we're // not just generating the same value over and over // and to make sure the batching changes the random // bytes. for (let n = 0; n < 130; n++) { const uuid = randomUUID(); assert(!last.has(uuid)); last.add(uuid); assert.strictEqual(typeof uuid, 'string'); assert.strictEqual(uuid.length, 36); testMatch(uuid); // Check that version 4 identifier was populated. assert.strictEqual( Buffer.from(uuid.substr(14, 2), 'hex')[0] & 0x40, 0x40); // Check that clock_seq_hi_and_reserved was populated with reserved bits. assert.strictEqual( Buffer.from(uuid.substr(19, 2), 'hex')[0] & 0b1100_0000, 0b1000_0000); } // Test non-buffered UUID's { testMatch(randomUUID({ disableEntropyCache: true })); testMatch(randomUUID({ disableEntropyCache: true })); testMatch(randomUUID({ disableEntropyCache: true })); testMatch(randomUUID({ disableEntropyCache: true })); assert.throws(() => randomUUID(1), { code: 'ERR_INVALID_ARG_TYPE' }); assert.throws(() => randomUUID({ disableEntropyCache: '' }), { code: 'ERR_INVALID_ARG_TYPE' }); }