Buckets:
| ; | |
| Object.defineProperty(exports, "__esModule", { value: true }); | |
| exports.unsafeStringify = void 0; | |
| const validate_js_1 = require("./validate.js"); | |
| const byteToHex = []; | |
| for (let i = 0; i < 256; ++i) { | |
| byteToHex.push((i + 0x100).toString(16).slice(1)); | |
| } | |
| function unsafeStringify(arr, offset = 0) { | |
| return (byteToHex[arr[offset + 0]] + | |
| byteToHex[arr[offset + 1]] + | |
| byteToHex[arr[offset + 2]] + | |
| byteToHex[arr[offset + 3]] + | |
| '-' + | |
| byteToHex[arr[offset + 4]] + | |
| byteToHex[arr[offset + 5]] + | |
| '-' + | |
| byteToHex[arr[offset + 6]] + | |
| byteToHex[arr[offset + 7]] + | |
| '-' + | |
| byteToHex[arr[offset + 8]] + | |
| byteToHex[arr[offset + 9]] + | |
| '-' + | |
| byteToHex[arr[offset + 10]] + | |
| byteToHex[arr[offset + 11]] + | |
| byteToHex[arr[offset + 12]] + | |
| byteToHex[arr[offset + 13]] + | |
| byteToHex[arr[offset + 14]] + | |
| byteToHex[arr[offset + 15]]).toLowerCase(); | |
| } | |
| exports.unsafeStringify = unsafeStringify; | |
| function stringify(arr, offset = 0) { | |
| const uuid = unsafeStringify(arr, offset); | |
| if (!(0, validate_js_1.default)(uuid)) { | |
| throw TypeError('Stringified UUID is invalid'); | |
| } | |
| return uuid; | |
| } | |
| exports.default = stringify; | |
Xet Storage Details
- Size:
- 1.27 kB
- Xet hash:
- 040233816d33b91915c363bc3018d434e1d45cacaaf226479aa86fbc2c81d017
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.