source:
imaps-frontend/node_modules/uuid/dist/cjs-browser/parse.js
Last change on this file was 79a0317, checked in by , 3 days ago | |
---|---|
|
|
File size: 720 bytes |
Line | |
---|---|
1 | "use strict"; |
2 | Object.defineProperty(exports, "__esModule", { value: true }); |
3 | const validate_js_1 = require("./validate.js"); |
4 | function parse(uuid) { |
5 | if (!(0, validate_js_1.default)(uuid)) { |
6 | throw TypeError('Invalid UUID'); |
7 | } |
8 | let v; |
9 | return Uint8Array.of((v = parseInt(uuid.slice(0, 8), 16)) >>> 24, (v >>> 16) & 0xff, (v >>> 8) & 0xff, v & 0xff, (v = parseInt(uuid.slice(9, 13), 16)) >>> 8, v & 0xff, (v = parseInt(uuid.slice(14, 18), 16)) >>> 8, v & 0xff, (v = parseInt(uuid.slice(19, 23), 16)) >>> 8, v & 0xff, ((v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000) & 0xff, (v / 0x100000000) & 0xff, (v >>> 24) & 0xff, (v >>> 16) & 0xff, (v >>> 8) & 0xff, v & 0xff); |
10 | } |
11 | exports.default = parse; |
Note:
See TracBrowser
for help on using the repository browser.