aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/node_modules/uuid/dist/parse.js
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2022-12-11 15:42:38 +0100
committerEgor Tensin <Egor.Tensin@gmail.com>2022-12-11 15:42:38 +0100
commit9857fae4d1136ef2ebfeffaaaf6ba22e1015401a (patch)
tree8d88c98d2100e29b668df3845088565cde9d80c6 /node_modules/uuid/dist/parse.js
parentbump Node version (diff)
downloadcleanup-path-9857fae4d1136ef2ebfeffaaaf6ba22e1015401a.tar.gz
cleanup-path-9857fae4d1136ef2ebfeffaaaf6ba22e1015401a.zip
upgrade actions/core
Diffstat (limited to 'node_modules/uuid/dist/parse.js')
-rw-r--r--node_modules/uuid/dist/parse.js45
1 files changed, 45 insertions, 0 deletions
diff --git a/node_modules/uuid/dist/parse.js b/node_modules/uuid/dist/parse.js
new file mode 100644
index 0000000..4c69fc3
--- /dev/null
+++ b/node_modules/uuid/dist/parse.js
@@ -0,0 +1,45 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = void 0;
+
+var _validate = _interopRequireDefault(require("./validate.js"));
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function parse(uuid) {
+ if (!(0, _validate.default)(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;
+}
+
+var _default = parse;
+exports.default = _default; \ No newline at end of file