PHP 8.2.30
Preview: bytesToUuid.js Size: 699 B
//opt/alt/alt-nodejs9/root/lib/node_modules/npm/node_modules.bundled/uuid/lib/bytesToUuid.js

/**
 * Convert array of 16 byte values to UUID string format of the form:
 * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
 */
var byteToHex = [];
for (var i = 0; i < 256; ++i) {
  byteToHex[i] = (i + 0x100).toString(16).substr(1);
}

function bytesToUuid(buf, offset) {
  var i = offset || 0;
  var bth = byteToHex;
  return bth[buf[i++]] + bth[buf[i++]] +
          bth[buf[i++]] + bth[buf[i++]] + '-' +
          bth[buf[i++]] + bth[buf[i++]] + '-' +
          bth[buf[i++]] + bth[buf[i++]] + '-' +
          bth[buf[i++]] + bth[buf[i++]] + '-' +
          bth[buf[i++]] + bth[buf[i++]] +
          bth[buf[i++]] + bth[buf[i++]] +
          bth[buf[i++]] + bth[buf[i++]];
}

module.exports = bytesToUuid;

Directory Contents

Dirs: 0 × Files: 5

Name Size Perms Modified Actions
699 B lrw-r--r-- 2021-09-28 11:28:18
Edit Download
969 B lrw-r--r-- 2021-09-28 11:28:18
Edit Download
239 B lrw-r--r-- 2021-09-28 11:28:18
Edit Download
2.25 KB lrw-r--r-- 2021-09-28 11:28:18
Edit Download
531 B lrw-r--r-- 2021-09-28 11:28:18
Edit Download

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