PHP 8.1.33
Preview: v4.js Size: 680 B
//lib/node_modules/npm/node_modules/uuid/v4.js

var rng = require('./lib/rng');
var bytesToUuid = require('./lib/bytesToUuid');

function v4(options, buf, offset) {
  var i = buf && offset || 0;

  if (typeof(options) == 'string') {
    buf = options === 'binary' ? new Array(16) : null;
    options = null;
  }
  options = options || {};

  var rnds = options.random || (options.rng || rng)();

  // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
  rnds[6] = (rnds[6] & 0x0f) | 0x40;
  rnds[8] = (rnds[8] & 0x3f) | 0x80;

  // Copy bytes to buffer, if provided
  if (buf) {
    for (var ii = 0; ii < 16; ++ii) {
      buf[i + ii] = rnds[ii];
    }
  }

  return buf || bytesToUuid(rnds);
}

module.exports = v4;

Directory Contents

Dirs: 2 × Files: 10

Name Size Perms Modified Actions
bin DIR
- drwxr-xr-x 2024-03-03 22:36:29
Edit Download
lib DIR
- drwxr-xr-x 2024-03-03 22:36:29
Edit Download
169 B lrw-r--r-- 2021-03-10 14:36:37
Edit Download
3.58 KB lrw-r--r-- 2021-03-10 14:36:37
Edit Download
120 B lrw-r--r-- 2021-03-10 14:36:37
Edit Download
1.08 KB lrw-r--r-- 2021-03-10 14:36:37
Edit Download
2.30 KB lrw-r--r-- 2021-03-10 14:36:37
Edit Download
8.33 KB lrw-r--r-- 2021-03-10 14:36:37
Edit Download
3.26 KB lrw-r--r-- 2021-03-10 14:36:37
Edit Download
106 B lrw-r--r-- 2021-03-10 14:36:37
Edit Download
680 B lrw-r--r-- 2021-03-10 14:36:37
Edit Download
109 B lrw-r--r-- 2021-03-10 14:36:37
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).