@pgarbe/cdk-ecr-sync 0.5.29 → 0.5.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.jsii +3 -3
- package/API.md +106 -50
- package/CHANGELOG.md +1 -1
- package/lib/ecr-sync.js +1 -1
- package/node_modules/aws-sdk/CHANGELOG.md +34 -1
- package/node_modules/aws-sdk/README.md +1 -1
- package/node_modules/aws-sdk/apis/appflow-2020-08-23.min.json +76 -70
- package/node_modules/aws-sdk/apis/cloudformation-2010-05-15.min.json +10 -8
- package/node_modules/aws-sdk/apis/cognito-idp-2016-04-18.min.json +155 -127
- package/node_modules/aws-sdk/apis/datasync-2018-11-09.min.json +80 -74
- package/node_modules/aws-sdk/apis/datasync-2018-11-09.paginators.json +10 -5
- package/node_modules/aws-sdk/apis/drs-2020-02-26.min.json +332 -205
- package/node_modules/aws-sdk/apis/drs-2020-02-26.paginators.json +12 -0
- package/node_modules/aws-sdk/apis/ec2-2016-11-15.min.json +17 -0
- package/node_modules/aws-sdk/apis/emr-serverless-2021-07-13.examples.json +5 -0
- package/node_modules/aws-sdk/apis/emr-serverless-2021-07-13.min.json +860 -0
- package/node_modules/aws-sdk/apis/emr-serverless-2021-07-13.paginators.json +16 -0
- package/node_modules/aws-sdk/apis/forecast-2018-06-26.min.json +82 -63
- package/node_modules/aws-sdk/apis/fsx-2018-03-01.min.json +135 -116
- package/node_modules/aws-sdk/apis/iotsitewise-2019-12-02.min.json +20 -15
- package/node_modules/aws-sdk/apis/lightsail-2016-11-28.min.json +155 -122
- package/node_modules/aws-sdk/apis/lookoutmetrics-2017-07-25.min.json +43 -15
- package/node_modules/aws-sdk/apis/mediaconvert-2017-08-29.min.json +176 -99
- package/node_modules/aws-sdk/apis/metadata.json +4 -0
- package/node_modules/aws-sdk/apis/networkmanager-2019-07-05.min.json +72 -3
- package/node_modules/aws-sdk/apis/sagemaker-2017-07-24.min.json +673 -649
- package/node_modules/aws-sdk/apis/transcribe-2017-10-26.min.json +37 -11
- package/node_modules/aws-sdk/apis/voice-id-2021-09-27.min.json +6 -0
- package/node_modules/aws-sdk/apis/voice-id-2021-09-27.paginators.json +8 -4
- package/node_modules/aws-sdk/clients/all.d.ts +1 -0
- package/node_modules/aws-sdk/clients/all.js +2 -1
- package/node_modules/aws-sdk/clients/apigateway.d.ts +327 -324
- package/node_modules/aws-sdk/clients/appflow.d.ts +17 -7
- package/node_modules/aws-sdk/clients/apprunner.d.ts +2 -2
- package/node_modules/aws-sdk/clients/cloudformation.d.ts +62 -53
- package/node_modules/aws-sdk/clients/cognitoidentityserviceprovider.d.ts +197 -162
- package/node_modules/aws-sdk/clients/datasync.d.ts +41 -15
- package/node_modules/aws-sdk/clients/drs.d.ts +173 -6
- package/node_modules/aws-sdk/clients/ec2.d.ts +35 -15
- package/node_modules/aws-sdk/clients/emrserverless.d.ts +890 -0
- package/node_modules/aws-sdk/clients/emrserverless.js +18 -0
- package/node_modules/aws-sdk/clients/forecastservice.d.ts +38 -2
- package/node_modules/aws-sdk/clients/fsx.d.ts +28 -3
- package/node_modules/aws-sdk/clients/iotsitewise.d.ts +23 -3
- package/node_modules/aws-sdk/clients/ivschat.d.ts +1 -1
- package/node_modules/aws-sdk/clients/lightsail.d.ts +40 -0
- package/node_modules/aws-sdk/clients/lookoutmetrics.d.ts +54 -5
- package/node_modules/aws-sdk/clients/mediaconvert.d.ts +83 -8
- package/node_modules/aws-sdk/clients/networkmanager.d.ts +56 -10
- package/node_modules/aws-sdk/clients/sagemaker.d.ts +53 -24
- package/node_modules/aws-sdk/clients/secretsmanager.d.ts +1 -1
- package/node_modules/aws-sdk/clients/transcribeservice.d.ts +479 -447
- package/node_modules/aws-sdk/clients/voiceid.d.ts +9 -1
- package/node_modules/aws-sdk/dist/aws-sdk-core-react-native.js +702 -233
- package/node_modules/aws-sdk/dist/aws-sdk-react-native.js +2499 -1776
- package/node_modules/aws-sdk/dist/aws-sdk.js +839 -320
- package/node_modules/aws-sdk/dist/aws-sdk.min.js +90 -90
- package/node_modules/aws-sdk/lib/config_service_placeholders.d.ts +2 -0
- package/node_modules/aws-sdk/lib/core.js +1 -1
- package/node_modules/aws-sdk/package.json +2 -2
- package/node_modules/uuid/CHANGELOG.md +132 -44
- package/node_modules/uuid/CONTRIBUTING.md +20 -0
- package/node_modules/uuid/LICENSE.md +1 -1
- package/node_modules/uuid/README.md +298 -152
- package/node_modules/uuid/dist/bin/uuid +2 -0
- package/node_modules/uuid/dist/bytesToUuid.js +26 -0
- package/node_modules/uuid/dist/esm-browser/bytesToUuid.js +18 -0
- package/node_modules/uuid/dist/esm-browser/index.js +4 -0
- package/node_modules/uuid/dist/esm-browser/md5.js +218 -0
- package/node_modules/uuid/dist/esm-browser/rng.js +15 -0
- package/node_modules/uuid/dist/esm-browser/sha1.js +91 -0
- package/node_modules/uuid/{v1.js → dist/esm-browser/v1.js} +34 -48
- package/node_modules/uuid/dist/esm-browser/v3.js +4 -0
- package/node_modules/uuid/dist/esm-browser/v35.js +56 -0
- package/node_modules/uuid/dist/esm-browser/v4.js +27 -0
- package/node_modules/uuid/dist/esm-browser/v5.js +4 -0
- package/node_modules/uuid/dist/esm-node/bytesToUuid.js +18 -0
- package/node_modules/uuid/dist/esm-node/index.js +4 -0
- package/node_modules/uuid/dist/esm-node/md5.js +13 -0
- package/node_modules/uuid/dist/esm-node/rng.js +4 -0
- package/node_modules/uuid/dist/esm-node/sha1.js +13 -0
- package/node_modules/uuid/dist/esm-node/v1.js +95 -0
- package/node_modules/uuid/dist/esm-node/v3.js +4 -0
- package/node_modules/uuid/{lib → dist/esm-node}/v35.js +21 -22
- package/node_modules/uuid/dist/esm-node/v4.js +27 -0
- package/node_modules/uuid/dist/esm-node/v5.js +4 -0
- package/node_modules/uuid/dist/index.js +39 -0
- package/node_modules/uuid/{lib → dist}/md5-browser.js +58 -50
- package/node_modules/uuid/dist/md5.js +23 -0
- package/node_modules/uuid/dist/rng-browser.js +21 -0
- package/node_modules/uuid/dist/rng.js +14 -0
- package/node_modules/uuid/dist/sha1-browser.js +95 -0
- package/node_modules/uuid/dist/sha1.js +23 -0
- package/node_modules/uuid/dist/umd/uuid.min.js +1 -0
- package/node_modules/uuid/dist/umd/uuidv1.min.js +1 -0
- package/node_modules/uuid/dist/umd/uuidv3.min.js +1 -0
- package/node_modules/uuid/dist/umd/uuidv4.min.js +1 -0
- package/node_modules/uuid/dist/umd/uuidv5.min.js +1 -0
- package/node_modules/uuid/dist/uuid-bin.js +67 -0
- package/node_modules/uuid/dist/v1.js +107 -0
- package/node_modules/uuid/dist/v3.js +16 -0
- package/node_modules/uuid/dist/v35.js +69 -0
- package/node_modules/uuid/dist/v4.js +40 -0
- package/node_modules/uuid/dist/v5.js +16 -0
- package/node_modules/uuid/package.json +92 -19
- package/node_modules/uuid/wrapper.mjs +5 -0
- package/package.json +7 -7
- package/releasetag.txt +1 -1
- package/version.txt +1 -1
- package/node_modules/uuid/.eslintrc.json +0 -47
- package/node_modules/uuid/AUTHORS +0 -5
- package/node_modules/uuid/README_js.md +0 -280
- package/node_modules/uuid/bin/uuid +0 -65
- package/node_modules/uuid/index.js +0 -8
- package/node_modules/uuid/lib/bytesToUuid.js +0 -24
- package/node_modules/uuid/lib/md5.js +0 -25
- package/node_modules/uuid/lib/rng-browser.js +0 -34
- package/node_modules/uuid/lib/rng.js +0 -8
- package/node_modules/uuid/lib/sha1-browser.js +0 -89
- package/node_modules/uuid/lib/sha1.js +0 -25
- package/node_modules/uuid/v3.js +0 -4
- package/node_modules/uuid/v4.js +0 -29
- package/node_modules/uuid/v5.js +0 -3
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Browser-compatible JavaScript MD5
|
|
3
|
+
*
|
|
4
|
+
* Modification of JavaScript MD5
|
|
5
|
+
* https://github.com/blueimp/JavaScript-MD5
|
|
6
|
+
*
|
|
7
|
+
* Copyright 2011, Sebastian Tschan
|
|
8
|
+
* https://blueimp.net
|
|
9
|
+
*
|
|
10
|
+
* Licensed under the MIT license:
|
|
11
|
+
* https://opensource.org/licenses/MIT
|
|
12
|
+
*
|
|
13
|
+
* Based on
|
|
14
|
+
* A JavaScript implementation of the RSA Data Security, Inc. MD5 Message
|
|
15
|
+
* Digest Algorithm, as defined in RFC 1321.
|
|
16
|
+
* Version 2.2 Copyright (C) Paul Johnston 1999 - 2009
|
|
17
|
+
* Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
|
|
18
|
+
* Distributed under the BSD License
|
|
19
|
+
* See http://pajhome.org.uk/crypt/md5 for more info.
|
|
20
|
+
*/
|
|
21
|
+
function md5(bytes) {
|
|
22
|
+
if (typeof bytes == 'string') {
|
|
23
|
+
var msg = unescape(encodeURIComponent(bytes)); // UTF8 escape
|
|
24
|
+
|
|
25
|
+
bytes = new Array(msg.length);
|
|
26
|
+
|
|
27
|
+
for (var i = 0; i < msg.length; i++) {
|
|
28
|
+
bytes[i] = msg.charCodeAt(i);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return md5ToHexEncodedArray(wordsToMd5(bytesToWords(bytes), bytes.length * 8));
|
|
33
|
+
}
|
|
34
|
+
/*
|
|
35
|
+
* Convert an array of little-endian words to an array of bytes
|
|
36
|
+
*/
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
function md5ToHexEncodedArray(input) {
|
|
40
|
+
var i;
|
|
41
|
+
var x;
|
|
42
|
+
var output = [];
|
|
43
|
+
var length32 = input.length * 32;
|
|
44
|
+
var hexTab = '0123456789abcdef';
|
|
45
|
+
var hex;
|
|
46
|
+
|
|
47
|
+
for (i = 0; i < length32; i += 8) {
|
|
48
|
+
x = input[i >> 5] >>> i % 32 & 0xff;
|
|
49
|
+
hex = parseInt(hexTab.charAt(x >>> 4 & 0x0f) + hexTab.charAt(x & 0x0f), 16);
|
|
50
|
+
output.push(hex);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return output;
|
|
54
|
+
}
|
|
55
|
+
/*
|
|
56
|
+
* Calculate the MD5 of an array of little-endian words, and a bit length.
|
|
57
|
+
*/
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
function wordsToMd5(x, len) {
|
|
61
|
+
/* append padding */
|
|
62
|
+
x[len >> 5] |= 0x80 << len % 32;
|
|
63
|
+
x[(len + 64 >>> 9 << 4) + 14] = len;
|
|
64
|
+
var i;
|
|
65
|
+
var olda;
|
|
66
|
+
var oldb;
|
|
67
|
+
var oldc;
|
|
68
|
+
var oldd;
|
|
69
|
+
var a = 1732584193;
|
|
70
|
+
var b = -271733879;
|
|
71
|
+
var c = -1732584194;
|
|
72
|
+
var d = 271733878;
|
|
73
|
+
|
|
74
|
+
for (i = 0; i < x.length; i += 16) {
|
|
75
|
+
olda = a;
|
|
76
|
+
oldb = b;
|
|
77
|
+
oldc = c;
|
|
78
|
+
oldd = d;
|
|
79
|
+
a = md5ff(a, b, c, d, x[i], 7, -680876936);
|
|
80
|
+
d = md5ff(d, a, b, c, x[i + 1], 12, -389564586);
|
|
81
|
+
c = md5ff(c, d, a, b, x[i + 2], 17, 606105819);
|
|
82
|
+
b = md5ff(b, c, d, a, x[i + 3], 22, -1044525330);
|
|
83
|
+
a = md5ff(a, b, c, d, x[i + 4], 7, -176418897);
|
|
84
|
+
d = md5ff(d, a, b, c, x[i + 5], 12, 1200080426);
|
|
85
|
+
c = md5ff(c, d, a, b, x[i + 6], 17, -1473231341);
|
|
86
|
+
b = md5ff(b, c, d, a, x[i + 7], 22, -45705983);
|
|
87
|
+
a = md5ff(a, b, c, d, x[i + 8], 7, 1770035416);
|
|
88
|
+
d = md5ff(d, a, b, c, x[i + 9], 12, -1958414417);
|
|
89
|
+
c = md5ff(c, d, a, b, x[i + 10], 17, -42063);
|
|
90
|
+
b = md5ff(b, c, d, a, x[i + 11], 22, -1990404162);
|
|
91
|
+
a = md5ff(a, b, c, d, x[i + 12], 7, 1804603682);
|
|
92
|
+
d = md5ff(d, a, b, c, x[i + 13], 12, -40341101);
|
|
93
|
+
c = md5ff(c, d, a, b, x[i + 14], 17, -1502002290);
|
|
94
|
+
b = md5ff(b, c, d, a, x[i + 15], 22, 1236535329);
|
|
95
|
+
a = md5gg(a, b, c, d, x[i + 1], 5, -165796510);
|
|
96
|
+
d = md5gg(d, a, b, c, x[i + 6], 9, -1069501632);
|
|
97
|
+
c = md5gg(c, d, a, b, x[i + 11], 14, 643717713);
|
|
98
|
+
b = md5gg(b, c, d, a, x[i], 20, -373897302);
|
|
99
|
+
a = md5gg(a, b, c, d, x[i + 5], 5, -701558691);
|
|
100
|
+
d = md5gg(d, a, b, c, x[i + 10], 9, 38016083);
|
|
101
|
+
c = md5gg(c, d, a, b, x[i + 15], 14, -660478335);
|
|
102
|
+
b = md5gg(b, c, d, a, x[i + 4], 20, -405537848);
|
|
103
|
+
a = md5gg(a, b, c, d, x[i + 9], 5, 568446438);
|
|
104
|
+
d = md5gg(d, a, b, c, x[i + 14], 9, -1019803690);
|
|
105
|
+
c = md5gg(c, d, a, b, x[i + 3], 14, -187363961);
|
|
106
|
+
b = md5gg(b, c, d, a, x[i + 8], 20, 1163531501);
|
|
107
|
+
a = md5gg(a, b, c, d, x[i + 13], 5, -1444681467);
|
|
108
|
+
d = md5gg(d, a, b, c, x[i + 2], 9, -51403784);
|
|
109
|
+
c = md5gg(c, d, a, b, x[i + 7], 14, 1735328473);
|
|
110
|
+
b = md5gg(b, c, d, a, x[i + 12], 20, -1926607734);
|
|
111
|
+
a = md5hh(a, b, c, d, x[i + 5], 4, -378558);
|
|
112
|
+
d = md5hh(d, a, b, c, x[i + 8], 11, -2022574463);
|
|
113
|
+
c = md5hh(c, d, a, b, x[i + 11], 16, 1839030562);
|
|
114
|
+
b = md5hh(b, c, d, a, x[i + 14], 23, -35309556);
|
|
115
|
+
a = md5hh(a, b, c, d, x[i + 1], 4, -1530992060);
|
|
116
|
+
d = md5hh(d, a, b, c, x[i + 4], 11, 1272893353);
|
|
117
|
+
c = md5hh(c, d, a, b, x[i + 7], 16, -155497632);
|
|
118
|
+
b = md5hh(b, c, d, a, x[i + 10], 23, -1094730640);
|
|
119
|
+
a = md5hh(a, b, c, d, x[i + 13], 4, 681279174);
|
|
120
|
+
d = md5hh(d, a, b, c, x[i], 11, -358537222);
|
|
121
|
+
c = md5hh(c, d, a, b, x[i + 3], 16, -722521979);
|
|
122
|
+
b = md5hh(b, c, d, a, x[i + 6], 23, 76029189);
|
|
123
|
+
a = md5hh(a, b, c, d, x[i + 9], 4, -640364487);
|
|
124
|
+
d = md5hh(d, a, b, c, x[i + 12], 11, -421815835);
|
|
125
|
+
c = md5hh(c, d, a, b, x[i + 15], 16, 530742520);
|
|
126
|
+
b = md5hh(b, c, d, a, x[i + 2], 23, -995338651);
|
|
127
|
+
a = md5ii(a, b, c, d, x[i], 6, -198630844);
|
|
128
|
+
d = md5ii(d, a, b, c, x[i + 7], 10, 1126891415);
|
|
129
|
+
c = md5ii(c, d, a, b, x[i + 14], 15, -1416354905);
|
|
130
|
+
b = md5ii(b, c, d, a, x[i + 5], 21, -57434055);
|
|
131
|
+
a = md5ii(a, b, c, d, x[i + 12], 6, 1700485571);
|
|
132
|
+
d = md5ii(d, a, b, c, x[i + 3], 10, -1894986606);
|
|
133
|
+
c = md5ii(c, d, a, b, x[i + 10], 15, -1051523);
|
|
134
|
+
b = md5ii(b, c, d, a, x[i + 1], 21, -2054922799);
|
|
135
|
+
a = md5ii(a, b, c, d, x[i + 8], 6, 1873313359);
|
|
136
|
+
d = md5ii(d, a, b, c, x[i + 15], 10, -30611744);
|
|
137
|
+
c = md5ii(c, d, a, b, x[i + 6], 15, -1560198380);
|
|
138
|
+
b = md5ii(b, c, d, a, x[i + 13], 21, 1309151649);
|
|
139
|
+
a = md5ii(a, b, c, d, x[i + 4], 6, -145523070);
|
|
140
|
+
d = md5ii(d, a, b, c, x[i + 11], 10, -1120210379);
|
|
141
|
+
c = md5ii(c, d, a, b, x[i + 2], 15, 718787259);
|
|
142
|
+
b = md5ii(b, c, d, a, x[i + 9], 21, -343485551);
|
|
143
|
+
a = safeAdd(a, olda);
|
|
144
|
+
b = safeAdd(b, oldb);
|
|
145
|
+
c = safeAdd(c, oldc);
|
|
146
|
+
d = safeAdd(d, oldd);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
return [a, b, c, d];
|
|
150
|
+
}
|
|
151
|
+
/*
|
|
152
|
+
* Convert an array bytes to an array of little-endian words
|
|
153
|
+
* Characters >255 have their high-byte silently ignored.
|
|
154
|
+
*/
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
function bytesToWords(input) {
|
|
158
|
+
var i;
|
|
159
|
+
var output = [];
|
|
160
|
+
output[(input.length >> 2) - 1] = undefined;
|
|
161
|
+
|
|
162
|
+
for (i = 0; i < output.length; i += 1) {
|
|
163
|
+
output[i] = 0;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
var length8 = input.length * 8;
|
|
167
|
+
|
|
168
|
+
for (i = 0; i < length8; i += 8) {
|
|
169
|
+
output[i >> 5] |= (input[i / 8] & 0xff) << i % 32;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
return output;
|
|
173
|
+
}
|
|
174
|
+
/*
|
|
175
|
+
* Add integers, wrapping at 2^32. This uses 16-bit operations internally
|
|
176
|
+
* to work around bugs in some JS interpreters.
|
|
177
|
+
*/
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
function safeAdd(x, y) {
|
|
181
|
+
var lsw = (x & 0xffff) + (y & 0xffff);
|
|
182
|
+
var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
|
|
183
|
+
return msw << 16 | lsw & 0xffff;
|
|
184
|
+
}
|
|
185
|
+
/*
|
|
186
|
+
* Bitwise rotate a 32-bit number to the left.
|
|
187
|
+
*/
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
function bitRotateLeft(num, cnt) {
|
|
191
|
+
return num << cnt | num >>> 32 - cnt;
|
|
192
|
+
}
|
|
193
|
+
/*
|
|
194
|
+
* These functions implement the four basic operations the algorithm uses.
|
|
195
|
+
*/
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
function md5cmn(q, a, b, x, s, t) {
|
|
199
|
+
return safeAdd(bitRotateLeft(safeAdd(safeAdd(a, q), safeAdd(x, t)), s), b);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
function md5ff(a, b, c, d, x, s, t) {
|
|
203
|
+
return md5cmn(b & c | ~b & d, a, b, x, s, t);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
function md5gg(a, b, c, d, x, s, t) {
|
|
207
|
+
return md5cmn(b & d | c & ~d, a, b, x, s, t);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
function md5hh(a, b, c, d, x, s, t) {
|
|
211
|
+
return md5cmn(b ^ c ^ d, a, b, x, s, t);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
function md5ii(a, b, c, d, x, s, t) {
|
|
215
|
+
return md5cmn(c ^ (b | ~d), a, b, x, s, t);
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
export default md5;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// Unique ID creation requires a high quality random # generator. In the browser we therefore
|
|
2
|
+
// require the crypto API and do not support built-in fallback to lower quality random number
|
|
3
|
+
// generators (like Math.random()).
|
|
4
|
+
// getRandomValues needs to be invoked in a context where "this" is a Crypto implementation. Also,
|
|
5
|
+
// find the complete implementation of crypto (msCrypto) on IE11.
|
|
6
|
+
var getRandomValues = typeof crypto != 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto != 'undefined' && typeof msCrypto.getRandomValues == 'function' && msCrypto.getRandomValues.bind(msCrypto);
|
|
7
|
+
var rnds8 = new Uint8Array(16); // eslint-disable-line no-undef
|
|
8
|
+
|
|
9
|
+
export default function rng() {
|
|
10
|
+
if (!getRandomValues) {
|
|
11
|
+
throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
return getRandomValues(rnds8);
|
|
15
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
// Adapted from Chris Veness' SHA1 code at
|
|
2
|
+
// http://www.movable-type.co.uk/scripts/sha1.html
|
|
3
|
+
function f(s, x, y, z) {
|
|
4
|
+
switch (s) {
|
|
5
|
+
case 0:
|
|
6
|
+
return x & y ^ ~x & z;
|
|
7
|
+
|
|
8
|
+
case 1:
|
|
9
|
+
return x ^ y ^ z;
|
|
10
|
+
|
|
11
|
+
case 2:
|
|
12
|
+
return x & y ^ x & z ^ y & z;
|
|
13
|
+
|
|
14
|
+
case 3:
|
|
15
|
+
return x ^ y ^ z;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function ROTL(x, n) {
|
|
20
|
+
return x << n | x >>> 32 - n;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function sha1(bytes) {
|
|
24
|
+
var K = [0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6];
|
|
25
|
+
var H = [0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0];
|
|
26
|
+
|
|
27
|
+
if (typeof bytes == 'string') {
|
|
28
|
+
var msg = unescape(encodeURIComponent(bytes)); // UTF8 escape
|
|
29
|
+
|
|
30
|
+
bytes = new Array(msg.length);
|
|
31
|
+
|
|
32
|
+
for (var i = 0; i < msg.length; i++) {
|
|
33
|
+
bytes[i] = msg.charCodeAt(i);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
bytes.push(0x80);
|
|
38
|
+
var l = bytes.length / 4 + 2;
|
|
39
|
+
var N = Math.ceil(l / 16);
|
|
40
|
+
var M = new Array(N);
|
|
41
|
+
|
|
42
|
+
for (var i = 0; i < N; i++) {
|
|
43
|
+
M[i] = new Array(16);
|
|
44
|
+
|
|
45
|
+
for (var j = 0; j < 16; j++) {
|
|
46
|
+
M[i][j] = bytes[i * 64 + j * 4] << 24 | bytes[i * 64 + j * 4 + 1] << 16 | bytes[i * 64 + j * 4 + 2] << 8 | bytes[i * 64 + j * 4 + 3];
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
M[N - 1][14] = (bytes.length - 1) * 8 / Math.pow(2, 32);
|
|
51
|
+
M[N - 1][14] = Math.floor(M[N - 1][14]);
|
|
52
|
+
M[N - 1][15] = (bytes.length - 1) * 8 & 0xffffffff;
|
|
53
|
+
|
|
54
|
+
for (var i = 0; i < N; i++) {
|
|
55
|
+
var W = new Array(80);
|
|
56
|
+
|
|
57
|
+
for (var t = 0; t < 16; t++) {
|
|
58
|
+
W[t] = M[i][t];
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
for (var t = 16; t < 80; t++) {
|
|
62
|
+
W[t] = ROTL(W[t - 3] ^ W[t - 8] ^ W[t - 14] ^ W[t - 16], 1);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
var a = H[0];
|
|
66
|
+
var b = H[1];
|
|
67
|
+
var c = H[2];
|
|
68
|
+
var d = H[3];
|
|
69
|
+
var e = H[4];
|
|
70
|
+
|
|
71
|
+
for (var t = 0; t < 80; t++) {
|
|
72
|
+
var s = Math.floor(t / 20);
|
|
73
|
+
var T = ROTL(a, 5) + f(s, b, c, d) + e + K[s] + W[t] >>> 0;
|
|
74
|
+
e = d;
|
|
75
|
+
d = c;
|
|
76
|
+
c = ROTL(b, 30) >>> 0;
|
|
77
|
+
b = a;
|
|
78
|
+
a = T;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
H[0] = H[0] + a >>> 0;
|
|
82
|
+
H[1] = H[1] + b >>> 0;
|
|
83
|
+
H[2] = H[2] + c >>> 0;
|
|
84
|
+
H[3] = H[3] + d >>> 0;
|
|
85
|
+
H[4] = H[4] + e >>> 0;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
return [H[0] >> 24 & 0xff, H[0] >> 16 & 0xff, H[0] >> 8 & 0xff, H[0] & 0xff, H[1] >> 24 & 0xff, H[1] >> 16 & 0xff, H[1] >> 8 & 0xff, H[1] & 0xff, H[2] >> 24 & 0xff, H[2] >> 16 & 0xff, H[2] >> 8 & 0xff, H[2] & 0xff, H[3] >> 24 & 0xff, H[3] >> 16 & 0xff, H[3] >> 8 & 0xff, H[3] & 0xff, H[4] >> 24 & 0xff, H[4] >> 16 & 0xff, H[4] >> 8 & 0xff, H[4] & 0xff];
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export default sha1;
|
|
@@ -1,104 +1,90 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
// **`v1()` - Generate time-based UUID**
|
|
1
|
+
import rng from './rng.js';
|
|
2
|
+
import bytesToUuid from './bytesToUuid.js'; // **`v1()` - Generate time-based UUID**
|
|
5
3
|
//
|
|
6
4
|
// Inspired by https://github.com/LiosK/UUID.js
|
|
7
5
|
// and http://docs.python.org/library/uuid.html
|
|
8
6
|
|
|
9
7
|
var _nodeId;
|
|
10
|
-
var _clockseq;
|
|
11
8
|
|
|
12
|
-
// Previous uuid creation time
|
|
9
|
+
var _clockseq; // Previous uuid creation time
|
|
10
|
+
|
|
11
|
+
|
|
13
12
|
var _lastMSecs = 0;
|
|
14
|
-
var _lastNSecs = 0;
|
|
13
|
+
var _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details
|
|
15
14
|
|
|
16
|
-
// See https://github.com/broofa/node-uuid for API details
|
|
17
15
|
function v1(options, buf, offset) {
|
|
18
16
|
var i = buf && offset || 0;
|
|
19
17
|
var b = buf || [];
|
|
20
|
-
|
|
21
18
|
options = options || {};
|
|
22
19
|
var node = options.node || _nodeId;
|
|
23
|
-
var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq;
|
|
24
|
-
|
|
25
|
-
// node and clockseq need to be initialized to random values if they're not
|
|
20
|
+
var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not
|
|
26
21
|
// specified. We do this lazily to minimize issues related to insufficient
|
|
27
22
|
// system entropy. See #189
|
|
23
|
+
|
|
28
24
|
if (node == null || clockseq == null) {
|
|
29
|
-
var seedBytes = rng();
|
|
25
|
+
var seedBytes = options.random || (options.rng || rng)();
|
|
26
|
+
|
|
30
27
|
if (node == null) {
|
|
31
28
|
// Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)
|
|
32
|
-
node = _nodeId = [
|
|
33
|
-
seedBytes[0] | 0x01,
|
|
34
|
-
seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]
|
|
35
|
-
];
|
|
29
|
+
node = _nodeId = [seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]];
|
|
36
30
|
}
|
|
31
|
+
|
|
37
32
|
if (clockseq == null) {
|
|
38
33
|
// Per 4.2.2, randomize (14 bit) clockseq
|
|
39
34
|
clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;
|
|
40
35
|
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
// UUID timestamps are 100 nano-second units since the Gregorian epoch,
|
|
36
|
+
} // UUID timestamps are 100 nano-second units since the Gregorian epoch,
|
|
44
37
|
// (1582-10-15 00:00). JSNumbers aren't precise enough for this, so
|
|
45
38
|
// time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'
|
|
46
39
|
// (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.
|
|
47
|
-
var msecs = options.msecs !== undefined ? options.msecs : new Date().getTime();
|
|
48
40
|
|
|
49
|
-
|
|
41
|
+
|
|
42
|
+
var msecs = options.msecs !== undefined ? options.msecs : new Date().getTime(); // Per 4.2.1.2, use count of uuid's generated during the current clock
|
|
50
43
|
// cycle to simulate higher resolution clock
|
|
51
|
-
var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1;
|
|
52
44
|
|
|
53
|
-
// Time since last uuid creation (in msecs)
|
|
54
|
-
|
|
45
|
+
var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs)
|
|
46
|
+
|
|
47
|
+
var dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000; // Per 4.2.1.2, Bump clockseq on clock regression
|
|
55
48
|
|
|
56
|
-
// Per 4.2.1.2, Bump clockseq on clock regression
|
|
57
49
|
if (dt < 0 && options.clockseq === undefined) {
|
|
58
50
|
clockseq = clockseq + 1 & 0x3fff;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
// Reset nsecs if clock regresses (new clockseq) or we've moved onto a new
|
|
51
|
+
} // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new
|
|
62
52
|
// time interval
|
|
53
|
+
|
|
54
|
+
|
|
63
55
|
if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {
|
|
64
56
|
nsecs = 0;
|
|
65
|
-
}
|
|
57
|
+
} // Per 4.2.1.2 Throw error if too many uuids are requested
|
|
58
|
+
|
|
66
59
|
|
|
67
|
-
// Per 4.2.1.2 Throw error if too many uuids are requested
|
|
68
60
|
if (nsecs >= 10000) {
|
|
69
|
-
throw new Error(
|
|
61
|
+
throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");
|
|
70
62
|
}
|
|
71
63
|
|
|
72
64
|
_lastMSecs = msecs;
|
|
73
65
|
_lastNSecs = nsecs;
|
|
74
|
-
_clockseq = clockseq;
|
|
66
|
+
_clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch
|
|
75
67
|
|
|
76
|
-
|
|
77
|
-
msecs += 12219292800000;
|
|
68
|
+
msecs += 12219292800000; // `time_low`
|
|
78
69
|
|
|
79
|
-
// `time_low`
|
|
80
70
|
var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;
|
|
81
71
|
b[i++] = tl >>> 24 & 0xff;
|
|
82
72
|
b[i++] = tl >>> 16 & 0xff;
|
|
83
73
|
b[i++] = tl >>> 8 & 0xff;
|
|
84
|
-
b[i++] = tl & 0xff;
|
|
74
|
+
b[i++] = tl & 0xff; // `time_mid`
|
|
85
75
|
|
|
86
|
-
|
|
87
|
-
var tmh = (msecs / 0x100000000 * 10000) & 0xfffffff;
|
|
76
|
+
var tmh = msecs / 0x100000000 * 10000 & 0xfffffff;
|
|
88
77
|
b[i++] = tmh >>> 8 & 0xff;
|
|
89
|
-
b[i++] = tmh & 0xff;
|
|
78
|
+
b[i++] = tmh & 0xff; // `time_high_and_version`
|
|
90
79
|
|
|
91
|
-
// `time_high_and_version`
|
|
92
80
|
b[i++] = tmh >>> 24 & 0xf | 0x10; // include version
|
|
93
|
-
b[i++] = tmh >>> 16 & 0xff;
|
|
94
81
|
|
|
95
|
-
// `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)
|
|
96
|
-
|
|
82
|
+
b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)
|
|
83
|
+
|
|
84
|
+
b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low`
|
|
97
85
|
|
|
98
|
-
// `
|
|
99
|
-
b[i++] = clockseq & 0xff;
|
|
86
|
+
b[i++] = clockseq & 0xff; // `node`
|
|
100
87
|
|
|
101
|
-
// `node`
|
|
102
88
|
for (var n = 0; n < 6; ++n) {
|
|
103
89
|
b[i + n] = node[n];
|
|
104
90
|
}
|
|
@@ -106,4 +92,4 @@ function v1(options, buf, offset) {
|
|
|
106
92
|
return buf ? buf : bytesToUuid(b);
|
|
107
93
|
}
|
|
108
94
|
|
|
109
|
-
|
|
95
|
+
export default v1;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import bytesToUuid from './bytesToUuid.js';
|
|
2
|
+
|
|
3
|
+
function uuidToBytes(uuid) {
|
|
4
|
+
// Note: We assume we're being passed a valid uuid string
|
|
5
|
+
var bytes = [];
|
|
6
|
+
uuid.replace(/[a-fA-F0-9]{2}/g, function (hex) {
|
|
7
|
+
bytes.push(parseInt(hex, 16));
|
|
8
|
+
});
|
|
9
|
+
return bytes;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function stringToBytes(str) {
|
|
13
|
+
str = unescape(encodeURIComponent(str)); // UTF8 escape
|
|
14
|
+
|
|
15
|
+
var bytes = new Array(str.length);
|
|
16
|
+
|
|
17
|
+
for (var i = 0; i < str.length; i++) {
|
|
18
|
+
bytes[i] = str.charCodeAt(i);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
return bytes;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export var DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8';
|
|
25
|
+
export var URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8';
|
|
26
|
+
export default function (name, version, hashfunc) {
|
|
27
|
+
var generateUUID = function generateUUID(value, namespace, buf, offset) {
|
|
28
|
+
var off = buf && offset || 0;
|
|
29
|
+
if (typeof value == 'string') value = stringToBytes(value);
|
|
30
|
+
if (typeof namespace == 'string') namespace = uuidToBytes(namespace);
|
|
31
|
+
if (!Array.isArray(value)) throw TypeError('value must be an array of bytes');
|
|
32
|
+
if (!Array.isArray(namespace) || namespace.length !== 16) throw TypeError('namespace must be uuid string or an Array of 16 byte values'); // Per 4.3
|
|
33
|
+
|
|
34
|
+
var bytes = hashfunc(namespace.concat(value));
|
|
35
|
+
bytes[6] = bytes[6] & 0x0f | version;
|
|
36
|
+
bytes[8] = bytes[8] & 0x3f | 0x80;
|
|
37
|
+
|
|
38
|
+
if (buf) {
|
|
39
|
+
for (var idx = 0; idx < 16; ++idx) {
|
|
40
|
+
buf[off + idx] = bytes[idx];
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
return buf || bytesToUuid(bytes);
|
|
45
|
+
}; // Function#name is not settable on some platforms (#270)
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
try {
|
|
49
|
+
generateUUID.name = name;
|
|
50
|
+
} catch (err) {} // For CommonJS default export support
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
generateUUID.DNS = DNS;
|
|
54
|
+
generateUUID.URL = URL;
|
|
55
|
+
return generateUUID;
|
|
56
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import rng from './rng.js';
|
|
2
|
+
import bytesToUuid from './bytesToUuid.js';
|
|
3
|
+
|
|
4
|
+
function v4(options, buf, offset) {
|
|
5
|
+
var i = buf && offset || 0;
|
|
6
|
+
|
|
7
|
+
if (typeof options == 'string') {
|
|
8
|
+
buf = options === 'binary' ? new Array(16) : null;
|
|
9
|
+
options = null;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
options = options || {};
|
|
13
|
+
var rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
|
|
14
|
+
|
|
15
|
+
rnds[6] = rnds[6] & 0x0f | 0x40;
|
|
16
|
+
rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
|
|
17
|
+
|
|
18
|
+
if (buf) {
|
|
19
|
+
for (var ii = 0; ii < 16; ++ii) {
|
|
20
|
+
buf[i + ii] = rnds[ii];
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
return buf || bytesToUuid(rnds);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export default v4;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Convert array of 16 byte values to UUID string format of the form:
|
|
3
|
+
* XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
|
|
4
|
+
*/
|
|
5
|
+
var byteToHex = [];
|
|
6
|
+
|
|
7
|
+
for (var i = 0; i < 256; ++i) {
|
|
8
|
+
byteToHex[i] = (i + 0x100).toString(16).substr(1);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
function bytesToUuid(buf, offset) {
|
|
12
|
+
var i = offset || 0;
|
|
13
|
+
var bth = byteToHex; // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4
|
|
14
|
+
|
|
15
|
+
return [bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], '-', bth[buf[i++]], bth[buf[i++]], '-', bth[buf[i++]], bth[buf[i++]], '-', bth[buf[i++]], bth[buf[i++]], '-', bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], bth[buf[i++]]].join('');
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export default bytesToUuid;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import crypto from 'crypto';
|
|
2
|
+
|
|
3
|
+
function md5(bytes) {
|
|
4
|
+
if (Array.isArray(bytes)) {
|
|
5
|
+
bytes = Buffer.from(bytes);
|
|
6
|
+
} else if (typeof bytes === 'string') {
|
|
7
|
+
bytes = Buffer.from(bytes, 'utf8');
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
return crypto.createHash('md5').update(bytes).digest();
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export default md5;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import crypto from 'crypto';
|
|
2
|
+
|
|
3
|
+
function sha1(bytes) {
|
|
4
|
+
if (Array.isArray(bytes)) {
|
|
5
|
+
bytes = Buffer.from(bytes);
|
|
6
|
+
} else if (typeof bytes === 'string') {
|
|
7
|
+
bytes = Buffer.from(bytes, 'utf8');
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
return crypto.createHash('sha1').update(bytes).digest();
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export default sha1;
|