@ovok/core 0.4.36 → 0.4.38
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/dist/client/auth/account-storage.d.ts +1 -0
- package/dist/client/auth/account-storage.js +2 -1
- package/dist/{utils → client}/auth/exchange-code.d.ts +1 -1
- package/dist/{utils → client}/auth/generate-code-challenge-and-verifier.js +5 -17
- package/dist/{utils → client}/auth/handle-tenant-code.d.ts +1 -1
- package/dist/{utils → client}/auth/handle-tenant-code.js +1 -1
- package/dist/client/auth/methods/appleLogin.js +2 -6
- package/dist/client/auth/methods/changePassword.js +2 -1
- package/dist/client/auth/methods/getSessions.js +2 -1
- package/dist/client/auth/methods/googleLogin.js +2 -6
- package/dist/client/auth/methods/login.js +26 -44
- package/dist/client/auth/methods/logout.js +2 -1
- package/dist/client/auth/methods/requestDeleteUser.js +5 -4
- package/dist/client/auth/methods/revokeSessions.js +2 -1
- package/dist/client/auth/methods/socialLogin.d.ts +7 -0
- package/dist/client/auth/methods/socialLogin.js +11 -0
- package/dist/client/auth/session-fetch.d.ts +35 -0
- package/dist/client/auth/session-fetch.js +206 -0
- package/dist/client/auth/session-http.d.ts +11 -0
- package/dist/client/auth/session-http.js +169 -0
- package/dist/client/auth/sha256.d.ts +2 -0
- package/dist/client/auth/sha256.js +65 -0
- package/dist/{utils → client}/auth/start-login.d.ts +2 -2
- package/dist/client/change-history/methods.js +2 -1
- package/dist/client/cms/methods.js +16 -28
- package/dist/client/consent/methods.js +3 -2
- package/dist/client/email/methods.js +2 -1
- package/dist/client/errors/ovok-error-utils.d.ts +6 -0
- package/dist/client/errors/ovok-error-utils.js +10 -1
- package/dist/client/errors/ovok-error.js +6 -13
- package/dist/client/errors/rate-limit-error.js +2 -6
- package/dist/client/experience/methods.js +28 -37
- package/dist/client/invites/methods.js +8 -12
- package/dist/client/notifications/methods.js +5 -5
- package/dist/client/observation/fhir-systems.d.ts +4 -0
- package/dist/client/observation/fhir-systems.js +7 -0
- package/dist/client/observation/methods/generateObservationBodiesByMeasurement.js +23 -29
- package/dist/client/observation/methods/getLatestObservationsByCodes.js +6 -9
- package/dist/client/observation/methods/observationsToMeasurements.js +44 -91
- package/dist/client/observation/services/base-observation-service.js +4 -3
- package/dist/client/observation/services/blood-pressure.js +1 -4
- package/dist/client/observation/services/{baby-sleep.d.ts → component-observation-services.d.ts} +18 -13
- package/dist/client/observation/services/component-observation-services.js +69 -0
- package/dist/client/observation/services/creator.d.ts +1 -2
- package/dist/client/observation/services/creator.js +15 -33
- package/dist/client/observation/services/ecg-observation-fragments.js +5 -6
- package/dist/client/observation/services/ecg.js +3 -2
- package/dist/client/observation/services/lipid-panel.js +8 -12
- package/dist/client/observation/services/measurement-time.d.ts +4 -0
- package/dist/client/observation/services/measurement-time.js +6 -0
- package/dist/client/observation/services/single-value-services.d.ts +36 -0
- package/dist/client/observation/services/single-value-services.js +100 -0
- package/dist/client/observation/services/uric-acid-service.js +6 -7
- package/dist/client/observation/types/generate-measurement/HealthConnectTypes.d.ts +2 -458
- package/dist/client/observation/types/generate-measurement/HealthConnectTypes.js +0 -6
- package/dist/client/offline/offline-measurement-queue.js +31 -28
- package/dist/client/ovok-client.d.ts +7 -15
- package/dist/client/ovok-client.js +54 -398
- package/dist/client/patient/methods.js +27 -36
- package/dist/client/patient-sharing/methods.js +4 -4
- package/dist/client/platform/methods.js +21 -30
- package/dist/client/platform/types.d.ts +3 -6
- package/dist/client/query-string.d.ts +3 -0
- package/dist/client/query-string.js +15 -0
- package/dist/client/questionnaire-response/methods/createQuestionnaireResponseWithObservations.js +2 -1
- package/dist/client/questionnaire-response/methods/extractQuestionnaireObservations.js +1 -2
- package/dist/client/questionnaire-response/methods/populateQuestionnaire.js +1 -2
- package/dist/client/questionnaire-response/methods/submitQuestionnaireResponse.js +2 -1
- package/dist/client/request-options.d.ts +2 -0
- package/dist/client/request-options.js +6 -0
- package/dist/client/signals/errors.js +2 -6
- package/dist/client/signals/methods.js +22 -22
- package/dist/client/slim/live-read.d.ts +4 -0
- package/dist/client/slim/live-read.js +87 -0
- package/dist/client/slim/methods.d.ts +3 -0
- package/dist/client/slim/methods.js +73 -166
- package/dist/client/storage.js +3 -2
- package/dist/conformance/capability-requirements.js +1 -1
- package/dist/conformance/capability.js +8 -7
- package/dist/hooks/account-hooks.js +6 -68
- package/dist/hooks/api-hooks.d.ts +10 -6
- package/dist/hooks/api-hooks.js +29 -88
- package/dist/hooks/cms-hooks.js +8 -13
- package/dist/hooks/email-hooks.js +1 -40
- package/dist/hooks/experience-hooks.js +4 -60
- package/dist/hooks/index.d.ts +2 -2
- package/dist/hooks/index.js +4 -4
- package/dist/hooks/invites-hooks.js +0 -1
- package/dist/hooks/notification-hooks.d.ts +4 -1
- package/dist/hooks/notification-hooks.js +29 -86
- package/dist/hooks/notification-invalidation.d.ts +6 -0
- package/dist/hooks/notification-invalidation.js +52 -0
- package/dist/hooks/notification-note-hooks.js +13 -28
- package/dist/hooks/observation-hooks.js +2 -4
- package/dist/hooks/patient-hooks.js +13 -113
- package/dist/hooks/patient-sharing-hooks.js +2 -7
- package/dist/hooks/platform-hooks.js +3 -51
- package/dist/hooks/poll-hooks.js +10 -8
- package/dist/hooks/signals-alert-hooks.js +4 -6
- package/dist/hooks/signals-hooks.js +2 -45
- package/package.json +1 -1
- package/dist/client/observation/services/baby-sleep.js +0 -69
- package/dist/client/observation/services/blood-glucose.d.ts +0 -12
- package/dist/client/observation/services/blood-glucose.js +0 -36
- package/dist/client/observation/services/body-temperature.d.ts +0 -13
- package/dist/client/observation/services/body-temperature.js +0 -36
- package/dist/client/observation/services/body-weight.d.ts +0 -13
- package/dist/client/observation/services/body-weight.js +0 -36
- package/dist/client/observation/services/heart-rate-variability.d.ts +0 -13
- package/dist/client/observation/services/heart-rate-variability.js +0 -38
- package/dist/client/observation/services/heart-rate.d.ts +0 -13
- package/dist/client/observation/services/heart-rate.js +0 -39
- package/dist/client/observation/services/respiratory-rate.d.ts +0 -13
- package/dist/client/observation/services/respiratory-rate.js +0 -38
- package/dist/client/observation/services/respiratory-therapy.d.ts +0 -28
- package/dist/client/observation/services/respiratory-therapy.js +0 -69
- package/dist/client/observation/services/resting-heart-rate.d.ts +0 -13
- package/dist/client/observation/services/resting-heart-rate.js +0 -38
- package/dist/client/observation/services/vo2-max.d.ts +0 -13
- package/dist/client/observation/services/vo2-max.js +0 -38
- package/dist/client/observation/services/walking-heart-rate-average.d.ts +0 -12
- package/dist/client/observation/services/walking-heart-rate-average.js +0 -38
- package/dist/utils/auth/sha256.d.ts +0 -8
- package/dist/utils/auth/sha256.js +0 -300
- /package/dist/{utils → client}/auth/exchange-code.js +0 -0
- /package/dist/{utils → client}/auth/generate-code-challenge-and-verifier.d.ts +0 -0
- /package/dist/{utils → client}/auth/start-login.js +0 -0
|
@@ -1,300 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.sha256 = void 0;
|
|
4
|
-
/* eslint-disable max-lines */
|
|
5
|
-
exports.sha256 = (function () {
|
|
6
|
-
/*
|
|
7
|
-
* Configurable variables. You may need to tweak these to be compatible with
|
|
8
|
-
* the server-side, but the defaults work in most cases.
|
|
9
|
-
*/
|
|
10
|
-
let hexcase = 0; /* hex output format. 0 - lowercase; 1 - uppercase */
|
|
11
|
-
let b64pad = ""; /* base-64 pad character. "=" for strict RFC compliance */
|
|
12
|
-
/*
|
|
13
|
-
* These are the functions you'll usually want to call
|
|
14
|
-
* They take string arguments and return either hex or base-64 encoded strings
|
|
15
|
-
*/
|
|
16
|
-
function hex_sha256(s) {
|
|
17
|
-
return rstr2hex(rstr_sha256(str2rstr_utf8(s)));
|
|
18
|
-
}
|
|
19
|
-
function hex_hmac_sha256(k, d) {
|
|
20
|
-
return rstr2hex(rstr_hmac_sha256(str2rstr_utf8(k), str2rstr_utf8(d)));
|
|
21
|
-
}
|
|
22
|
-
function b64_hmac_sha256(k, d) {
|
|
23
|
-
return rstr2b64(rstr_hmac_sha256(str2rstr_utf8(k), str2rstr_utf8(d)));
|
|
24
|
-
}
|
|
25
|
-
function any_hmac_sha256(k, d, e) {
|
|
26
|
-
return rstr2any(rstr_hmac_sha256(str2rstr_utf8(k), str2rstr_utf8(d)), e);
|
|
27
|
-
}
|
|
28
|
-
/*
|
|
29
|
-
* Calculate the sha256 of a raw string
|
|
30
|
-
*/
|
|
31
|
-
function rstr_sha256(s) {
|
|
32
|
-
return binb2rstr(binb_sha256(rstr2binb(s), s.length * 8));
|
|
33
|
-
}
|
|
34
|
-
/*
|
|
35
|
-
* Calculate the HMAC-sha256 of a key and some data (raw strings)
|
|
36
|
-
*/
|
|
37
|
-
function rstr_hmac_sha256(key, data) {
|
|
38
|
-
let bkey = rstr2binb(key);
|
|
39
|
-
if (bkey.length > 16) {
|
|
40
|
-
bkey = binb_sha256(bkey, key.length * 8);
|
|
41
|
-
}
|
|
42
|
-
const ipad = Array(16), opad = Array(16);
|
|
43
|
-
for (let i = 0; i < 16; i++) {
|
|
44
|
-
ipad[i] = bkey[i] ^ 0x36363636;
|
|
45
|
-
opad[i] = bkey[i] ^ 0x5c5c5c5c;
|
|
46
|
-
}
|
|
47
|
-
const hash = binb_sha256(ipad.concat(rstr2binb(data)), 512 + data.length * 8);
|
|
48
|
-
return binb2rstr(binb_sha256(opad.concat(hash), 512 + 256));
|
|
49
|
-
}
|
|
50
|
-
/*
|
|
51
|
-
* Convert a raw string to a hex string
|
|
52
|
-
*/
|
|
53
|
-
function rstr2hex(input) {
|
|
54
|
-
try {
|
|
55
|
-
hexcase;
|
|
56
|
-
}
|
|
57
|
-
catch (_a) {
|
|
58
|
-
hexcase = 0;
|
|
59
|
-
}
|
|
60
|
-
const hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef";
|
|
61
|
-
let output = "";
|
|
62
|
-
let x;
|
|
63
|
-
for (let i = 0; i < input.length; i++) {
|
|
64
|
-
x = input.charCodeAt(i);
|
|
65
|
-
output += hex_tab.charAt((x >>> 4) & 0x0f) + hex_tab.charAt(x & 0x0f);
|
|
66
|
-
}
|
|
67
|
-
return output;
|
|
68
|
-
}
|
|
69
|
-
/*
|
|
70
|
-
* Convert a raw string to a base-64 string
|
|
71
|
-
*/
|
|
72
|
-
function rstr2b64(input) {
|
|
73
|
-
try {
|
|
74
|
-
b64pad;
|
|
75
|
-
}
|
|
76
|
-
catch (_a) {
|
|
77
|
-
b64pad = "";
|
|
78
|
-
}
|
|
79
|
-
const tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
80
|
-
let output = "";
|
|
81
|
-
const len = input.length;
|
|
82
|
-
for (let i = 0; i < len; i += 3) {
|
|
83
|
-
const triplet = (input.charCodeAt(i) << 16) |
|
|
84
|
-
(i + 1 < len ? input.charCodeAt(i + 1) << 8 : 0) |
|
|
85
|
-
(i + 2 < len ? input.charCodeAt(i + 2) : 0);
|
|
86
|
-
for (let j = 0; j < 4; j++) {
|
|
87
|
-
if (i * 8 + j * 6 > input.length * 8) {
|
|
88
|
-
output += b64pad;
|
|
89
|
-
}
|
|
90
|
-
else {
|
|
91
|
-
output += tab.charAt((triplet >>> (6 * (3 - j))) & 0x3f);
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
return output;
|
|
96
|
-
}
|
|
97
|
-
/*
|
|
98
|
-
* Convert a raw string to an arbitrary string encoding
|
|
99
|
-
*/
|
|
100
|
-
function rstr2any(input, encoding) {
|
|
101
|
-
const divisor = encoding.length;
|
|
102
|
-
const remainders = [];
|
|
103
|
-
let i, q, x, quotient;
|
|
104
|
-
/* Convert to an array of 16-bit big-endian values, forming the dividend */
|
|
105
|
-
let dividend = Array(Math.ceil(input.length / 2));
|
|
106
|
-
for (i = 0; i < dividend.length; i++) {
|
|
107
|
-
dividend[i] =
|
|
108
|
-
(input.charCodeAt(i * 2) << 8) | input.charCodeAt(i * 2 + 1);
|
|
109
|
-
}
|
|
110
|
-
/*
|
|
111
|
-
* Repeatedly perform a long division. The binary array forms the dividend,
|
|
112
|
-
* the length of the encoding is the divisor. Once computed, the quotient
|
|
113
|
-
* forms the dividend for the next step. We stop when the dividend is zero.
|
|
114
|
-
* All remainders are stored for later use.
|
|
115
|
-
*/
|
|
116
|
-
while (dividend.length > 0) {
|
|
117
|
-
quotient = [];
|
|
118
|
-
x = 0;
|
|
119
|
-
for (i = 0; i < dividend.length; i++) {
|
|
120
|
-
x = (x << 16) + dividend[i];
|
|
121
|
-
q = Math.floor(x / divisor);
|
|
122
|
-
x -= q * divisor;
|
|
123
|
-
if (quotient.length > 0 || q > 0) {
|
|
124
|
-
quotient[quotient.length] = q;
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
remainders[remainders.length] = x;
|
|
128
|
-
dividend = quotient;
|
|
129
|
-
}
|
|
130
|
-
/* Convert the remainders to the output string */
|
|
131
|
-
let output = "";
|
|
132
|
-
for (i = remainders.length - 1; i >= 0; i--) {
|
|
133
|
-
output += encoding.charAt(remainders[i]);
|
|
134
|
-
}
|
|
135
|
-
/* Append leading zero equivalents */
|
|
136
|
-
const full_length = Math.ceil((input.length * 8) / (Math.log(encoding.length) / Math.log(2)));
|
|
137
|
-
for (i = output.length; i < full_length; i++) {
|
|
138
|
-
output = encoding[0] + output;
|
|
139
|
-
}
|
|
140
|
-
return output;
|
|
141
|
-
}
|
|
142
|
-
/*
|
|
143
|
-
* Encode a string as utf-8.
|
|
144
|
-
* For efficiency, this assumes the input is valid utf-16.
|
|
145
|
-
*/
|
|
146
|
-
function str2rstr_utf8(input) {
|
|
147
|
-
let output = "";
|
|
148
|
-
let i = -1;
|
|
149
|
-
let x, y;
|
|
150
|
-
while (++i < input.length) {
|
|
151
|
-
/* Decode utf-16 surrogate pairs */
|
|
152
|
-
x = input.charCodeAt(i);
|
|
153
|
-
y = i + 1 < input.length ? input.charCodeAt(i + 1) : 0;
|
|
154
|
-
if (0xd800 <= x && x <= 0xdbff && 0xdc00 <= y && y <= 0xdfff) {
|
|
155
|
-
x = 0x10000 + ((x & 0x03ff) << 10) + (y & 0x03ff);
|
|
156
|
-
i++;
|
|
157
|
-
}
|
|
158
|
-
/* Encode output as utf-8 */
|
|
159
|
-
if (x <= 0x7f) {
|
|
160
|
-
output += String.fromCharCode(x);
|
|
161
|
-
}
|
|
162
|
-
else if (x <= 0x7ff) {
|
|
163
|
-
output += String.fromCharCode(0xc0 | ((x >>> 6) & 0x1f), 0x80 | (x & 0x3f));
|
|
164
|
-
}
|
|
165
|
-
else if (x <= 0xffff) {
|
|
166
|
-
output += String.fromCharCode(0xe0 | ((x >>> 12) & 0x0f), 0x80 | ((x >>> 6) & 0x3f), 0x80 | (x & 0x3f));
|
|
167
|
-
}
|
|
168
|
-
else if (x <= 0x1fffff) {
|
|
169
|
-
output += String.fromCharCode(0xf0 | ((x >>> 18) & 0x07), 0x80 | ((x >>> 12) & 0x3f), 0x80 | ((x >>> 6) & 0x3f), 0x80 | (x & 0x3f));
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
return output;
|
|
173
|
-
}
|
|
174
|
-
/*
|
|
175
|
-
* Convert a raw string to an array of big-endian words
|
|
176
|
-
* Characters >255 have their high-byte silently ignored.
|
|
177
|
-
*/
|
|
178
|
-
function rstr2binb(input) {
|
|
179
|
-
const output = Array(input.length >> 2);
|
|
180
|
-
for (let i = 0; i < output.length; i++) {
|
|
181
|
-
output[i] = 0;
|
|
182
|
-
}
|
|
183
|
-
for (let i = 0; i < input.length * 8; i += 8) {
|
|
184
|
-
output[i >> 5] |= (input.charCodeAt(i / 8) & 0xff) << (24 - (i % 32));
|
|
185
|
-
}
|
|
186
|
-
return output;
|
|
187
|
-
}
|
|
188
|
-
/*
|
|
189
|
-
* Convert an array of big-endian words to a string
|
|
190
|
-
*/
|
|
191
|
-
function binb2rstr(input) {
|
|
192
|
-
let output = "";
|
|
193
|
-
for (let i = 0; i < input.length * 32; i += 8) {
|
|
194
|
-
output += String.fromCharCode((input[i >> 5] >>> (24 - (i % 32))) & 0xff);
|
|
195
|
-
}
|
|
196
|
-
return output;
|
|
197
|
-
}
|
|
198
|
-
/*
|
|
199
|
-
* Main sha256 function, with its support functions
|
|
200
|
-
*/
|
|
201
|
-
function sha256_S(X, n) {
|
|
202
|
-
return (X >>> n) | (X << (32 - n));
|
|
203
|
-
}
|
|
204
|
-
function sha256_R(X, n) {
|
|
205
|
-
return X >>> n;
|
|
206
|
-
}
|
|
207
|
-
function sha256_Ch(x, y, z) {
|
|
208
|
-
return (x & y) ^ (~x & z);
|
|
209
|
-
}
|
|
210
|
-
function sha256_Maj(x, y, z) {
|
|
211
|
-
return (x & y) ^ (x & z) ^ (y & z);
|
|
212
|
-
}
|
|
213
|
-
function sha256_Sigma0256(x) {
|
|
214
|
-
return sha256_S(x, 2) ^ sha256_S(x, 13) ^ sha256_S(x, 22);
|
|
215
|
-
}
|
|
216
|
-
function sha256_Sigma1256(x) {
|
|
217
|
-
return sha256_S(x, 6) ^ sha256_S(x, 11) ^ sha256_S(x, 25);
|
|
218
|
-
}
|
|
219
|
-
function sha256_Gamma0256(x) {
|
|
220
|
-
return sha256_S(x, 7) ^ sha256_S(x, 18) ^ sha256_R(x, 3);
|
|
221
|
-
}
|
|
222
|
-
function sha256_Gamma1256(x) {
|
|
223
|
-
return sha256_S(x, 17) ^ sha256_S(x, 19) ^ sha256_R(x, 10);
|
|
224
|
-
}
|
|
225
|
-
const sha256_K = [
|
|
226
|
-
1116352408, 1899447441, -1245643825, -373957723, 961987163, 1508970993,
|
|
227
|
-
-1841331548, -1424204075, -670586216, 310598401, 607225278, 1426881987,
|
|
228
|
-
1925078388, -2132889090, -1680079193, -1046744716, -459576895, -272742522,
|
|
229
|
-
264347078, 604807628, 770255983, 1249150122, 1555081692, 1996064986,
|
|
230
|
-
-1740746414, -1473132947, -1341970488, -1084653625, -958395405, -710438585,
|
|
231
|
-
113926993, 338241895, 666307205, 773529912, 1294757372, 1396182291,
|
|
232
|
-
1695183700, 1986661051, -2117940946, -1838011259, -1564481375, -1474664885,
|
|
233
|
-
-1035236496, -949202525, -778901479, -694614492, -200395387, 275423344,
|
|
234
|
-
430227734, 506948616, 659060556, 883997877, 958139571, 1322822218,
|
|
235
|
-
1537002063, 1747873779, 1955562222, 2024104815, -2067236844, -1933114872,
|
|
236
|
-
-1866530822, -1538233109, -1090935817, -965641998,
|
|
237
|
-
];
|
|
238
|
-
function binb_sha256(m, l) {
|
|
239
|
-
const HASH = [
|
|
240
|
-
1779033703, -1150833019, 1013904242, -1521486534, 1359893119, -1694144372,
|
|
241
|
-
528734635, 1541459225,
|
|
242
|
-
];
|
|
243
|
-
const W = new Array(64);
|
|
244
|
-
let a, b, c, d, e, f, g, h;
|
|
245
|
-
let i, j, T1, T2;
|
|
246
|
-
/* append padding */
|
|
247
|
-
m[l >> 5] |= 0x80 << (24 - (l % 32));
|
|
248
|
-
m[(((l + 64) >> 9) << 4) + 15] = l;
|
|
249
|
-
for (i = 0; i < m.length; i += 16) {
|
|
250
|
-
a = HASH[0];
|
|
251
|
-
b = HASH[1];
|
|
252
|
-
c = HASH[2];
|
|
253
|
-
d = HASH[3];
|
|
254
|
-
e = HASH[4];
|
|
255
|
-
f = HASH[5];
|
|
256
|
-
g = HASH[6];
|
|
257
|
-
h = HASH[7];
|
|
258
|
-
for (j = 0; j < 64; j++) {
|
|
259
|
-
if (j < 16) {
|
|
260
|
-
W[j] = m[j + i];
|
|
261
|
-
}
|
|
262
|
-
else {
|
|
263
|
-
W[j] = safe_add(safe_add(safe_add(sha256_Gamma1256(W[j - 2]), W[j - 7]), sha256_Gamma0256(W[j - 15])), W[j - 16]);
|
|
264
|
-
}
|
|
265
|
-
T1 = safe_add(safe_add(safe_add(safe_add(h, sha256_Sigma1256(e)), sha256_Ch(e, f, g)), sha256_K[j]), W[j]);
|
|
266
|
-
T2 = safe_add(sha256_Sigma0256(a), sha256_Maj(a, b, c));
|
|
267
|
-
h = g;
|
|
268
|
-
g = f;
|
|
269
|
-
f = e;
|
|
270
|
-
e = safe_add(d, T1);
|
|
271
|
-
d = c;
|
|
272
|
-
c = b;
|
|
273
|
-
b = a;
|
|
274
|
-
a = safe_add(T1, T2);
|
|
275
|
-
}
|
|
276
|
-
HASH[0] = safe_add(a, HASH[0]);
|
|
277
|
-
HASH[1] = safe_add(b, HASH[1]);
|
|
278
|
-
HASH[2] = safe_add(c, HASH[2]);
|
|
279
|
-
HASH[3] = safe_add(d, HASH[3]);
|
|
280
|
-
HASH[4] = safe_add(e, HASH[4]);
|
|
281
|
-
HASH[5] = safe_add(f, HASH[5]);
|
|
282
|
-
HASH[6] = safe_add(g, HASH[6]);
|
|
283
|
-
HASH[7] = safe_add(h, HASH[7]);
|
|
284
|
-
}
|
|
285
|
-
return HASH;
|
|
286
|
-
}
|
|
287
|
-
function safe_add(x, y) {
|
|
288
|
-
const lsw = (x & 0xffff) + (y & 0xffff);
|
|
289
|
-
const msw = (x >> 16) + (y >> 16) + (lsw >> 16);
|
|
290
|
-
return (msw << 16) | (lsw & 0xffff);
|
|
291
|
-
}
|
|
292
|
-
return {
|
|
293
|
-
hex: hex_sha256,
|
|
294
|
-
b64: b64_hmac_sha256,
|
|
295
|
-
any: any_hmac_sha256,
|
|
296
|
-
hex_hmac: hex_hmac_sha256,
|
|
297
|
-
b64_hmac: b64_hmac_sha256,
|
|
298
|
-
any_hmac: any_hmac_sha256,
|
|
299
|
-
};
|
|
300
|
-
})();
|
|
File without changes
|
|
File without changes
|
|
File without changes
|