Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 uid=33(www-data) gid=33(www-data) groups=33(www-data) Safe-mode: OFF (not secure) /var/www/html/wincloud_gateway/node_modules/uuid-random/ drwxr-xr-x | |
| Viewing file: Select action/file-type: var assert = require('assert');
var uuid = require('./index');
// Check format
var i;
for (i = 0; i < 10000; i++) {
assert(uuid.test(uuid()));
}
// Check the test function on known-[in]valid UUIDs
const healthyUuids = ['6514db12-0a68-4108-a8c9-3ddc6f489a26'];
const invalidUuids = [
'920b70bf-168a-458d-c1ac-50e488e5976f',
'633ca20d-1e9e-7b81-b725-82a595ce3515',
'knuth',
undefined,
null,
[],
42,
];
for (const healthyUuid of healthyUuids) {
assert(uuid.test(healthyUuid) === true);
assert(uuid.test(healthyUuid.toUpperCase()) === true);
}
for (const invalidUuid of invalidUuids) {
assert(uuid.test(invalidUuid) === false);
}
// Clear the buffer and change the randomBytes function to return 0s
uuid.clearBuffer();
uuid.randomBytes = function (length) {
return new Array(length).fill(0, 0, length);
};
assert(uuid() === '00000000-0000-4000-8000-000000000000');
|
:: Command execute :: | |
--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0046 ]-- |