source:
imaps-frontend/node_modules/uuid/dist/esm/parse.js@
79a0317
Last change on this file since 79a0317 was 79a0317, checked in by , 4 days ago | |
---|---|
|
|
File size: 612 bytes |
Line | |
---|---|
1 | import validate from './validate.js'; |
2 | function parse(uuid) { |
3 | if (!validate(uuid)) { |
4 | throw TypeError('Invalid UUID'); |
5 | } |
6 | let v; |
7 | 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); |
8 | } |
9 | export default parse; |
Note:
See TracBrowser
for help on using the repository browser.