From 9337aae8b1c87fad34884dacd5cd79d9591c60db Mon Sep 17 00:00:00 2001 From: RaindropsSys Date: Sat, 18 Nov 2023 11:34:36 +0100 Subject: Updated 39 files, added 86 files, deleted 40 files and renamed 2 files (automated) --- .../node_modules/uuid/dist/esm-node/parse.js | 35 ++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 includes/external/signal/node_modules/uuid/dist/esm-node/parse.js (limited to 'includes/external/signal/node_modules/uuid/dist/esm-node/parse.js') diff --git a/includes/external/signal/node_modules/uuid/dist/esm-node/parse.js b/includes/external/signal/node_modules/uuid/dist/esm-node/parse.js new file mode 100644 index 0000000..6421c5d --- /dev/null +++ b/includes/external/signal/node_modules/uuid/dist/esm-node/parse.js @@ -0,0 +1,35 @@ +import validate from './validate.js'; + +function parse(uuid) { + if (!validate(uuid)) { + throw TypeError('Invalid UUID'); + } + + let v; + const arr = new Uint8Array(16); // Parse ########-....-....-....-............ + + arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24; + arr[1] = v >>> 16 & 0xff; + arr[2] = v >>> 8 & 0xff; + arr[3] = v & 0xff; // Parse ........-####-....-....-............ + + arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8; + arr[5] = v & 0xff; // Parse ........-....-####-....-............ + + arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8; + arr[7] = v & 0xff; // Parse ........-....-....-####-............ + + arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8; + arr[9] = v & 0xff; // Parse ........-....-....-....-############ + // (Use "/" to avoid 32-bit truncation when bit-shifting high-order bytes) + + arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000 & 0xff; + arr[11] = v / 0x100000000 & 0xff; + arr[12] = v >>> 24 & 0xff; + arr[13] = v >>> 16 & 0xff; + arr[14] = v >>> 8 & 0xff; + arr[15] = v & 0xff; + return arr; +} + +export default parse; \ No newline at end of file -- cgit