@stryke/crypto 0.5.44 → 0.6.1

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.
Files changed (95) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/cloudflare.cjs +960 -0
  3. package/dist/cloudflare.d.cts +251 -0
  4. package/dist/cloudflare.d.cts.map +1 -0
  5. package/dist/cloudflare.d.mts +251 -0
  6. package/dist/cloudflare.d.mts.map +1 -0
  7. package/dist/cloudflare.mjs +942 -0
  8. package/dist/cloudflare.mjs.map +1 -0
  9. package/dist/index.cjs +16 -12
  10. package/dist/index.d.cts +2 -4
  11. package/dist/index.d.mts +2 -4
  12. package/dist/index.mjs +2 -4
  13. package/dist/neutral-BISXAuIW.cjs +868 -0
  14. package/dist/{encryption.d.mts → neutral-BJmyEdJq.d.mts} +77 -2
  15. package/dist/neutral-BJmyEdJq.d.mts.map +1 -0
  16. package/dist/neutral-BtZoJSl-.mjs +779 -0
  17. package/dist/neutral-BtZoJSl-.mjs.map +1 -0
  18. package/dist/{encryption.d.cts → neutral-CW6EXiYo.d.cts} +77 -2
  19. package/dist/neutral-CW6EXiYo.d.cts.map +1 -0
  20. package/dist/neutral.cjs +16 -16
  21. package/dist/neutral.d.cts +2 -4
  22. package/dist/neutral.d.mts +2 -4
  23. package/dist/neutral.mjs +2 -4
  24. package/dist/node.cjs +663 -0
  25. package/dist/node.d.cts +117 -0
  26. package/dist/node.d.cts.map +1 -0
  27. package/dist/node.d.mts +117 -0
  28. package/dist/node.d.mts.map +1 -0
  29. package/dist/node.mjs +654 -0
  30. package/dist/node.mjs.map +1 -0
  31. package/package.json +55 -20
  32. package/dist/base-64.cjs +0 -440
  33. package/dist/base-64.d.cts +0 -40
  34. package/dist/base-64.d.cts.map +0 -1
  35. package/dist/base-64.d.mts +0 -40
  36. package/dist/base-64.d.mts.map +0 -1
  37. package/dist/base-64.mjs +0 -438
  38. package/dist/base-64.mjs.map +0 -1
  39. package/dist/convert/src/array-buffer-to-string.cjs +0 -19
  40. package/dist/convert/src/array-buffer-to-string.mjs +0 -19
  41. package/dist/convert/src/array-buffer-to-string.mjs.map +0 -1
  42. package/dist/convert/src/neutral.cjs +0 -7
  43. package/dist/convert/src/neutral.mjs +0 -9
  44. package/dist/convert/src/parse-type-definition.cjs +0 -1
  45. package/dist/convert/src/parse-type-definition.mjs +0 -3
  46. package/dist/convert/src/string-to-uint8-array.cjs +0 -24
  47. package/dist/convert/src/string-to-uint8-array.mjs +0 -23
  48. package/dist/convert/src/string-to-uint8-array.mjs.map +0 -1
  49. package/dist/convert/src/string-to-utf8-array.cjs +0 -15
  50. package/dist/convert/src/string-to-utf8-array.mjs +0 -15
  51. package/dist/convert/src/string-to-utf8-array.mjs.map +0 -1
  52. package/dist/convert/src/uint8-array-to-stream.cjs +0 -22
  53. package/dist/convert/src/uint8-array-to-stream.mjs +0 -22
  54. package/dist/convert/src/uint8-array-to-stream.mjs.map +0 -1
  55. package/dist/convert/src/uint8-array-to-string.cjs +0 -15
  56. package/dist/convert/src/uint8-array-to-string.mjs +0 -16
  57. package/dist/convert/src/uint8-array-to-string.mjs.map +0 -1
  58. package/dist/convert/src/utf8-array-to-string.cjs +0 -15
  59. package/dist/convert/src/utf8-array-to-string.mjs +0 -15
  60. package/dist/convert/src/utf8-array-to-string.mjs.map +0 -1
  61. package/dist/encryption.cjs +0 -134
  62. package/dist/encryption.d.cts.map +0 -1
  63. package/dist/encryption.d.mts.map +0 -1
  64. package/dist/encryption.mjs +0 -129
  65. package/dist/encryption.mjs.map +0 -1
  66. package/dist/encryption.node.cjs +0 -63
  67. package/dist/encryption.node.d.cts +0 -42
  68. package/dist/encryption.node.d.cts.map +0 -1
  69. package/dist/encryption.node.d.mts +0 -42
  70. package/dist/encryption.node.d.mts.map +0 -1
  71. package/dist/encryption.node.mjs +0 -62
  72. package/dist/encryption.node.mjs.map +0 -1
  73. package/dist/hex.cjs +0 -62
  74. package/dist/hex.d.cts +0 -18
  75. package/dist/hex.d.cts.map +0 -1
  76. package/dist/hex.d.mts +0 -18
  77. package/dist/hex.d.mts.map +0 -1
  78. package/dist/hex.mjs +0 -61
  79. package/dist/hex.mjs.map +0 -1
  80. package/dist/type-checks/src/index.cjs +0 -5
  81. package/dist/type-checks/src/index.mjs +0 -7
  82. package/dist/type-checks/src/is-buffer.cjs +0 -12
  83. package/dist/type-checks/src/is-buffer.mjs +0 -12
  84. package/dist/type-checks/src/is-buffer.mjs.map +0 -1
  85. package/dist/type-checks/src/is-collection.cjs +0 -1
  86. package/dist/type-checks/src/is-collection.mjs +0 -3
  87. package/dist/type-checks/src/is-string.cjs +0 -12
  88. package/dist/type-checks/src/is-string.mjs +0 -12
  89. package/dist/type-checks/src/is-string.mjs.map +0 -1
  90. package/dist/type-checks/src/is-undefined.cjs +0 -8
  91. package/dist/type-checks/src/is-undefined.mjs +0 -8
  92. package/dist/type-checks/src/is-undefined.mjs.map +0 -1
  93. package/dist/type-checks/src/type-detect.cjs +0 -15
  94. package/dist/type-checks/src/type-detect.mjs +0 -17
  95. package/dist/type-checks/src/type-detect.mjs.map +0 -1
@@ -1,40 +0,0 @@
1
- //#region src/base-64.d.ts
2
- /**
3
- * Encodes a Uint8Array into a Base64 encoded Uint8Array.
4
- *
5
- * @credit https://github.com/hi-ogawa/js-utils
6
- *
7
- * @param input - The input Uint8Array or string to encode.
8
- * @returns The Base64 encoded Uint8Array.
9
- */
10
- declare function encodeBase64(input: Uint8Array | string): string;
11
- /**
12
- * Decodes a Base64 encoded Uint8Array into a Uint8Array.
13
- *
14
- * @credit https://github.com/hi-ogawa/js-utils
15
- *
16
- * @param input - The Base64 encoded Uint8Array or string to decode.
17
- * @returns The decoded Uint8Array.
18
- */
19
- declare function decodeBase64(input: Uint8Array | string): Uint8Array;
20
- /**
21
- * Converts a Base64 encoded string to a [Base64url](https://datatracker.ietf.org/doc/html/rfc7515#appendix-C) encoded string.
22
- *
23
- * @see https://datatracker.ietf.org/doc/html/rfc7515#appendix-C
24
- *
25
- * @param base64 - The Base64 encoded string to convert.
26
- * @returns The Base64url encoded string.
27
- */
28
- declare function base64ToBase64url(base64: string): string;
29
- /**
30
- * Converts a [Base64url](https://datatracker.ietf.org/doc/html/rfc7515#appendix-C) encoded string to a Base64 encoded string.
31
- *
32
- * @see https://datatracker.ietf.org/doc/html/rfc7515#appendix-C
33
- *
34
- * @param base64url - The Base64url encoded string to convert.
35
- * @returns The Base64 encoded string.
36
- */
37
- declare function base64FromBase64url(base64url: string): string;
38
- //#endregion
39
- export { base64FromBase64url, base64ToBase64url, decodeBase64, encodeBase64 };
40
- //# sourceMappingURL=base-64.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"base-64.d.mts","names":[],"sources":["../src/base-64.ts"],"sourcesContent":[],"mappings":";;AAoEA;AAmDA;AAkFA;AAYA;;;;iBAjJgB,YAAA,QAAoB;;;;;;;;;iBAmDpB,YAAA,QAAoB,sBAAsB;;;;;;;;;iBAkF1C,iBAAA;;;;;;;;;iBAYA,mBAAA"}
package/dist/base-64.mjs DELETED
@@ -1,438 +0,0 @@
1
- import { isUndefined } from "./type-checks/src/is-undefined.mjs";
2
- import { isString } from "./type-checks/src/is-string.mjs";
3
- import { stringToUint8Array } from "./convert/src/string-to-uint8-array.mjs";
4
- import { utf8ArrayToString } from "./convert/src/utf8-array-to-string.mjs";
5
- import "./convert/src/neutral.mjs";
6
-
7
- //#region src/base-64.ts
8
- const ENCODE_MAP = new Uint8Array([
9
- 65,
10
- 66,
11
- 67,
12
- 68,
13
- 69,
14
- 70,
15
- 71,
16
- 72,
17
- 73,
18
- 74,
19
- 75,
20
- 76,
21
- 77,
22
- 78,
23
- 79,
24
- 80,
25
- 81,
26
- 82,
27
- 83,
28
- 84,
29
- 85,
30
- 86,
31
- 87,
32
- 88,
33
- 89,
34
- 90,
35
- 97,
36
- 98,
37
- 99,
38
- 100,
39
- 101,
40
- 102,
41
- 103,
42
- 104,
43
- 105,
44
- 106,
45
- 107,
46
- 108,
47
- 109,
48
- 110,
49
- 111,
50
- 112,
51
- 113,
52
- 114,
53
- 115,
54
- 116,
55
- 117,
56
- 118,
57
- 119,
58
- 120,
59
- 121,
60
- 122,
61
- 48,
62
- 49,
63
- 50,
64
- 51,
65
- 52,
66
- 53,
67
- 54,
68
- 55,
69
- 56,
70
- 57,
71
- 43,
72
- 47
73
- ]);
74
- const ENCODE_PAD = 61;
75
- const DECODE_MAP = new Uint8Array([
76
- 100,
77
- 100,
78
- 100,
79
- 100,
80
- 100,
81
- 100,
82
- 100,
83
- 100,
84
- 100,
85
- 100,
86
- 100,
87
- 100,
88
- 100,
89
- 100,
90
- 100,
91
- 100,
92
- 100,
93
- 100,
94
- 100,
95
- 100,
96
- 100,
97
- 100,
98
- 100,
99
- 100,
100
- 100,
101
- 100,
102
- 100,
103
- 100,
104
- 100,
105
- 100,
106
- 100,
107
- 100,
108
- 100,
109
- 100,
110
- 100,
111
- 100,
112
- 100,
113
- 100,
114
- 100,
115
- 100,
116
- 100,
117
- 100,
118
- 100,
119
- 62,
120
- 100,
121
- 100,
122
- 100,
123
- 63,
124
- 52,
125
- 53,
126
- 54,
127
- 55,
128
- 56,
129
- 57,
130
- 58,
131
- 59,
132
- 60,
133
- 61,
134
- 100,
135
- 100,
136
- 100,
137
- 100,
138
- 100,
139
- 100,
140
- 100,
141
- 0,
142
- 1,
143
- 2,
144
- 3,
145
- 4,
146
- 5,
147
- 6,
148
- 7,
149
- 8,
150
- 9,
151
- 10,
152
- 11,
153
- 12,
154
- 13,
155
- 14,
156
- 15,
157
- 16,
158
- 17,
159
- 18,
160
- 19,
161
- 20,
162
- 21,
163
- 22,
164
- 23,
165
- 24,
166
- 25,
167
- 100,
168
- 100,
169
- 100,
170
- 100,
171
- 100,
172
- 100,
173
- 26,
174
- 27,
175
- 28,
176
- 29,
177
- 30,
178
- 31,
179
- 32,
180
- 33,
181
- 34,
182
- 35,
183
- 36,
184
- 37,
185
- 38,
186
- 39,
187
- 40,
188
- 41,
189
- 42,
190
- 43,
191
- 44,
192
- 45,
193
- 46,
194
- 47,
195
- 48,
196
- 49,
197
- 50,
198
- 51,
199
- 100,
200
- 100,
201
- 100,
202
- 100,
203
- 100,
204
- 100,
205
- 100,
206
- 100,
207
- 100,
208
- 100,
209
- 100,
210
- 100,
211
- 100,
212
- 100,
213
- 100,
214
- 100,
215
- 100,
216
- 100,
217
- 100,
218
- 100,
219
- 100,
220
- 100,
221
- 100,
222
- 100,
223
- 100,
224
- 100,
225
- 100,
226
- 100,
227
- 100,
228
- 100,
229
- 100,
230
- 100,
231
- 100,
232
- 100,
233
- 100,
234
- 100,
235
- 100,
236
- 100,
237
- 100,
238
- 100,
239
- 100,
240
- 100,
241
- 100,
242
- 100,
243
- 100,
244
- 100,
245
- 100,
246
- 100,
247
- 100,
248
- 100,
249
- 100,
250
- 100,
251
- 100,
252
- 100,
253
- 100,
254
- 100,
255
- 100,
256
- 100,
257
- 100,
258
- 100,
259
- 100,
260
- 100,
261
- 100,
262
- 100,
263
- 100,
264
- 100,
265
- 100,
266
- 100,
267
- 100,
268
- 100,
269
- 100,
270
- 100,
271
- 100,
272
- 100,
273
- 100,
274
- 100,
275
- 100,
276
- 100,
277
- 100,
278
- 100,
279
- 100,
280
- 100,
281
- 100,
282
- 100,
283
- 100,
284
- 100,
285
- 100,
286
- 100,
287
- 100,
288
- 100,
289
- 100,
290
- 100,
291
- 100,
292
- 100,
293
- 100,
294
- 100,
295
- 100,
296
- 100,
297
- 100,
298
- 100,
299
- 100,
300
- 100,
301
- 100,
302
- 100,
303
- 100,
304
- 100,
305
- 100,
306
- 100,
307
- 100,
308
- 100,
309
- 100,
310
- 100,
311
- 100,
312
- 100,
313
- 100,
314
- 100,
315
- 100,
316
- 100,
317
- 100,
318
- 100,
319
- 100,
320
- 100,
321
- 100,
322
- 100,
323
- 100,
324
- 100,
325
- 100,
326
- 100,
327
- 100,
328
- 100,
329
- 100,
330
- 100
331
- ]);
332
- /**
333
- * Encodes a Uint8Array into a Base64 encoded Uint8Array.
334
- *
335
- * @credit https://github.com/hi-ogawa/js-utils
336
- *
337
- * @param input - The input Uint8Array or string to encode.
338
- * @returns The Base64 encoded Uint8Array.
339
- */
340
- function encodeBase64(input) {
341
- if (isString(input)) input = stringToUint8Array(input);
342
- const xLen = input.length;
343
- const result = new Uint8Array(Math.ceil(xLen / 3) * 4);
344
- const chunkLen = Math.floor(xLen / 3);
345
- for (let i$1 = 0; i$1 < chunkLen; i$1++) {
346
- const chunk = input[3 * i$1 + 0] << 16 | input[3 * i$1 + 1] << 8 | input[3 * i$1 + 2];
347
- result[4 * i$1 + 0] = ENCODE_MAP[chunk >> 18 & 63];
348
- result[4 * i$1 + 1] = ENCODE_MAP[chunk >> 12 & 63];
349
- result[4 * i$1 + 2] = ENCODE_MAP[chunk >> 6 & 63];
350
- result[4 * i$1 + 3] = ENCODE_MAP[chunk >> 0 & 63];
351
- }
352
- const i = chunkLen;
353
- switch (xLen % 3) {
354
- case 1: {
355
- const chunk = input[3 * i + 0] << 16;
356
- result[4 * i + 0] = ENCODE_MAP[chunk >> 18 & 63];
357
- result[4 * i + 1] = ENCODE_MAP[chunk >> 12 & 63];
358
- result[4 * i + 2] = ENCODE_PAD;
359
- result[4 * i + 3] = ENCODE_PAD;
360
- break;
361
- }
362
- case 2: {
363
- const chunk = input[3 * i + 0] << 16 | input[3 * i + 1] << 8;
364
- result[4 * i + 0] = ENCODE_MAP[chunk >> 18 & 63];
365
- result[4 * i + 1] = ENCODE_MAP[chunk >> 12 & 63];
366
- result[4 * i + 2] = ENCODE_MAP[chunk >> 6 & 63];
367
- result[4 * i + 3] = ENCODE_PAD;
368
- break;
369
- }
370
- }
371
- return utf8ArrayToString(result);
372
- }
373
- /**
374
- * Decodes a Base64 encoded Uint8Array into a Uint8Array.
375
- *
376
- * @credit https://github.com/hi-ogawa/js-utils
377
- *
378
- * @param input - The Base64 encoded Uint8Array or string to decode.
379
- * @returns The decoded Uint8Array.
380
- */
381
- function decodeBase64(input) {
382
- if (isString(input)) input = stringToUint8Array(input);
383
- const yLen = input.length;
384
- if (yLen % 4 !== 0) throw new Error("invalid length");
385
- let padLen = 0;
386
- while (padLen < 2 && padLen < input.length && input[input.length - 1 - padLen] === ENCODE_PAD) padLen++;
387
- for (let i$1 = 0; i$1 < input.length - padLen; i$1++) if (isUndefined(input[i$1]) || isUndefined(DECODE_MAP[input[i$1]]) || DECODE_MAP[input[i$1]] >= 64) throw new Error("invalid data");
388
- const chunkLen = Math.floor((yLen - padLen) / 4);
389
- const xLen = 3 * chunkLen + (3 - padLen) % 3;
390
- const result = new Uint8Array(xLen);
391
- for (let i$1 = 0; i$1 < chunkLen; i$1++) {
392
- const chunk = DECODE_MAP[input[4 * i$1 + 0]] << 18 | DECODE_MAP[input[4 * i$1 + 1]] << 12 | DECODE_MAP[input[4 * i$1 + 2]] << 6 | DECODE_MAP[input[4 * i$1 + 3]] << 0;
393
- result[3 * i$1] = chunk >> 16 & 255;
394
- result[3 * i$1 + 1] = chunk >> 8 & 255;
395
- result[3 * i$1 + 2] = chunk >> 0 & 255;
396
- }
397
- const i = chunkLen;
398
- switch (xLen % 3) {
399
- case 1: {
400
- const chunk = DECODE_MAP[input[4 * i + 0]] << 18 | DECODE_MAP[input[4 * i + 1]] << 12;
401
- result[3 * i] = chunk >> 16 & 255;
402
- break;
403
- }
404
- case 2: {
405
- const chunk = DECODE_MAP[input[4 * i + 0]] << 18 | DECODE_MAP[input[4 * i + 1]] << 12 | DECODE_MAP[input[4 * i + 2]] << 6;
406
- result[3 * i] = chunk >> 16 & 255;
407
- result[3 * i + 1] = chunk >> 8 & 255;
408
- break;
409
- }
410
- }
411
- return result;
412
- }
413
- /**
414
- * Converts a Base64 encoded string to a [Base64url](https://datatracker.ietf.org/doc/html/rfc7515#appendix-C) encoded string.
415
- *
416
- * @see https://datatracker.ietf.org/doc/html/rfc7515#appendix-C
417
- *
418
- * @param base64 - The Base64 encoded string to convert.
419
- * @returns The Base64url encoded string.
420
- */
421
- function base64ToBase64url(base64) {
422
- return base64.replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/g, "");
423
- }
424
- /**
425
- * Converts a [Base64url](https://datatracker.ietf.org/doc/html/rfc7515#appendix-C) encoded string to a Base64 encoded string.
426
- *
427
- * @see https://datatracker.ietf.org/doc/html/rfc7515#appendix-C
428
- *
429
- * @param base64url - The Base64url encoded string to convert.
430
- * @returns The Base64 encoded string.
431
- */
432
- function base64FromBase64url(base64url) {
433
- return base64url.replace(/-/g, "+").replace(/_/g, "/") + "=".repeat((4 - base64url.length % 4) % 4);
434
- }
435
-
436
- //#endregion
437
- export { base64FromBase64url, base64ToBase64url, decodeBase64, encodeBase64 };
438
- //# sourceMappingURL=base-64.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"base-64.mjs","names":["i"],"sources":["../src/base-64.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { stringToUint8Array } from \"@stryke/convert/neutral\";\nimport { utf8ArrayToString } from \"@stryke/convert/utf8-array-to-string\";\nimport { isString } from \"@stryke/type-checks/is-string\";\nimport { isUndefined } from \"@stryke/type-checks/is-undefined\";\n\n// map 6 bits [0, 64) into ascii byte (8 bits)\n// generated by\n// Array.from(\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\", c => c.charCodeAt(0))\n// biome-ignore format:\nconst ENCODE_MAP = new Uint8Array([\n 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83,\n 84, 85, 86, 87, 88, 89, 90, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106,\n 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121,\n 122, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 43, 47\n]);\n\n// \"=\".codePointAt(0)\nconst ENCODE_PAD = 61;\n\n// inverse of ENCODE_MAP\n// generated by\n// ENCODE_MAP.reduce((acc, v, i) => { acc[v] = i; return acc }, Array(255).fill(100))\n// biome-ignore format:\nconst DECODE_MAP = new Uint8Array([\n 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,\n 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,\n 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 62, 100, 100,\n 100, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 100, 100, 100, 100, 100, 100,\n 100, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n 21, 22, 23, 24, 25, 100, 100, 100, 100, 100, 100, 26, 27, 28, 29, 30, 31, 32,\n 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51,\n 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,\n 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,\n 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,\n 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,\n 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,\n 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,\n 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,\n 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,\n 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100\n]);\n\n/**\n * Encodes a Uint8Array into a Base64 encoded Uint8Array.\n *\n * @credit https://github.com/hi-ogawa/js-utils\n *\n * @param input - The input Uint8Array or string to encode.\n * @returns The Base64 encoded Uint8Array.\n */\nexport function encodeBase64(input: Uint8Array | string): string {\n if (isString(input)) {\n input = stringToUint8Array(input);\n }\n\n const xLen = input.length;\n const result = new Uint8Array(Math.ceil(xLen / 3) * 4);\n const chunkLen = Math.floor(xLen / 3);\n\n // encode complete chunks\n for (let i = 0; i < chunkLen; i++) {\n const chunk =\n (input[3 * i + 0]! << 16) | (input[3 * i + 1]! << 8) | input[3 * i + 2]!;\n result[4 * i + 0] = ENCODE_MAP[(chunk >> 18) & 0b111111]!;\n result[4 * i + 1] = ENCODE_MAP[(chunk >> 12) & 0b111111]!;\n result[4 * i + 2] = ENCODE_MAP[(chunk >> 6) & 0b111111]!;\n result[4 * i + 3] = ENCODE_MAP[(chunk >> 0) & 0b111111]!;\n }\n\n // encode partial chunk with padding\n const i = chunkLen;\n switch (xLen % 3) {\n case 1: {\n const chunk = input[3 * i + 0]! << 16;\n result[4 * i + 0] = ENCODE_MAP[(chunk >> 18) & 0b111111]!;\n result[4 * i + 1] = ENCODE_MAP[(chunk >> 12) & 0b111111]!;\n result[4 * i + 2] = ENCODE_PAD;\n result[4 * i + 3] = ENCODE_PAD;\n break;\n }\n case 2: {\n const chunk = (input[3 * i + 0]! << 16) | (input[3 * i + 1]! << 8);\n result[4 * i + 0] = ENCODE_MAP[(chunk >> 18) & 0b111111]!;\n result[4 * i + 1] = ENCODE_MAP[(chunk >> 12) & 0b111111]!;\n result[4 * i + 2] = ENCODE_MAP[(chunk >> 6) & 0b111111]!;\n result[4 * i + 3] = ENCODE_PAD;\n break;\n }\n }\n\n return utf8ArrayToString(result);\n}\n\n/**\n * Decodes a Base64 encoded Uint8Array into a Uint8Array.\n *\n * @credit https://github.com/hi-ogawa/js-utils\n *\n * @param input - The Base64 encoded Uint8Array or string to decode.\n * @returns The decoded Uint8Array.\n */\nexport function decodeBase64(input: Uint8Array | string): Uint8Array {\n if (isString(input)) {\n input = stringToUint8Array(input);\n }\n\n const yLen = input.length;\n\n // validate length\n if (yLen % 4 !== 0) {\n throw new Error(\"invalid length\");\n }\n\n // get padding length\n let padLen = 0;\n while (\n padLen < 2 &&\n padLen < input.length &&\n input[input.length - 1 - padLen] === ENCODE_PAD\n ) {\n padLen++;\n }\n\n // validate encoding\n for (let i = 0; i < input.length - padLen; i++) {\n if (\n isUndefined(input[i]) ||\n isUndefined(DECODE_MAP[input[i]!]) ||\n DECODE_MAP[input[i]!]! >= 64\n ) {\n throw new Error(\"invalid data\");\n }\n }\n\n // validate encoding\n const chunkLen = Math.floor((yLen - padLen) / 4);\n const xLen = 3 * chunkLen + ((3 - padLen) % 3);\n const result = new Uint8Array(xLen);\n\n // decode complete chunks\n for (let i = 0; i < chunkLen; i++) {\n const chunk =\n (DECODE_MAP[input[4 * i + 0]!]! << 18) |\n (DECODE_MAP[input[4 * i + 1]!]! << 12) |\n (DECODE_MAP[input[4 * i + 2]!]! << 6) |\n (DECODE_MAP[input[4 * i + 3]!]! << 0);\n result[3 * i] = (chunk >> 16) & 0xff;\n result[3 * i + 1] = (chunk >> 8) & 0xff;\n result[3 * i + 2] = (chunk >> 0) & 0xff;\n }\n\n // decode partial chunk\n const i = chunkLen;\n switch (xLen % 3) {\n case 1: {\n const chunk =\n (DECODE_MAP[input[4 * i + 0]!]! << 18) |\n (DECODE_MAP[input[4 * i + 1]!]! << 12);\n result[3 * i] = (chunk >> 16) & 0xff;\n break;\n }\n case 2: {\n const chunk =\n (DECODE_MAP[input[4 * i + 0]!]! << 18) |\n (DECODE_MAP[input[4 * i + 1]!]! << 12) |\n (DECODE_MAP[input[4 * i + 2]!]! << 6);\n result[3 * i] = (chunk >> 16) & 0xff;\n result[3 * i + 1] = (chunk >> 8) & 0xff;\n break;\n }\n }\n\n return result;\n}\n\n/**\n * Converts a Base64 encoded string to a [Base64url](https://datatracker.ietf.org/doc/html/rfc7515#appendix-C) encoded string.\n *\n * @see https://datatracker.ietf.org/doc/html/rfc7515#appendix-C\n *\n * @param base64 - The Base64 encoded string to convert.\n * @returns The Base64url encoded string.\n */\nexport function base64ToBase64url(base64: string): string {\n return base64.replace(/\\+/g, \"-\").replace(/\\//g, \"_\").replace(/=+$/g, \"\");\n}\n\n/**\n * Converts a [Base64url](https://datatracker.ietf.org/doc/html/rfc7515#appendix-C) encoded string to a Base64 encoded string.\n *\n * @see https://datatracker.ietf.org/doc/html/rfc7515#appendix-C\n *\n * @param base64url - The Base64url encoded string to convert.\n * @returns The Base64 encoded string.\n */\nexport function base64FromBase64url(base64url: string): string {\n return (\n base64url.replace(/-/g, \"+\").replace(/_/g, \"/\") +\n \"=\".repeat((4 - (base64url.length % 4)) % 4)\n );\n}\n"],"mappings":";;;;;;;AA2BA,MAAM,aAAa,IAAI,WAAW;CAChC;CAAI;CAAI;CAAI;CAAI;CAAI;CAAI;CAAI;CAAI;CAAI;CAAI;CAAI;CAAI;CAAI;CAAI;CAAI;CAAI;CAAI;CAAI;CACxE;CAAI;CAAI;CAAI;CAAI;CAAI;CAAI;CAAI;CAAI;CAAI;CAAI;CAAK;CAAK;CAAK;CAAK;CAAK;CAAK;CACtE;CAAK;CAAK;CAAK;CAAK;CAAK;CAAK;CAAK;CAAK;CAAK;CAAK;CAAK;CAAK;CAAK;CAAK;CACtE;CAAK;CAAI;CAAI;CAAI;CAAI;CAAI;CAAI;CAAI;CAAI;CAAI;CAAI;CAAI;CAClD,CAAC;AAGF,MAAM,aAAa;AAMnB,MAAM,aAAa,IAAI,WAAW;CAChC;CAAK;CAAK;CAAK;CAAK;CAAK;CAAK;CAAK;CAAK;CAAK;CAAK;CAAK;CAAK;CAAK;CAAK;CACtE;CAAK;CAAK;CAAK;CAAK;CAAK;CAAK;CAAK;CAAK;CAAK;CAAK;CAAK;CAAK;CAAK;CAAK;CAC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I,OAAS,KAClC,WAAW,MAAM,IAAI,IAAI,OAAS;AACrC,UAAO,IAAI,KAAM,SAAS,KAAM;AAChC,UAAO,IAAI,IAAI,KAAM,SAAS,IAAK;AACnC;;;AAIJ,QAAO;;;;;;;;;;AAWT,SAAgB,kBAAkB,QAAwB;AACxD,QAAO,OAAO,QAAQ,OAAO,IAAI,CAAC,QAAQ,OAAO,IAAI,CAAC,QAAQ,QAAQ,GAAG;;;;;;;;;;AAW3E,SAAgB,oBAAoB,WAA2B;AAC7D,QACE,UAAU,QAAQ,MAAM,IAAI,CAAC,QAAQ,MAAM,IAAI,GAC/C,IAAI,QAAQ,IAAK,UAAU,SAAS,KAAM,EAAE"}
@@ -1,19 +0,0 @@
1
-
2
- //#region ../convert/src/array-buffer-to-string.ts
3
- /**
4
- * Convert an ArrayBuffer or Uint8Array to a string
5
- *
6
- * @param buffer - The ArrayBuffer or Uint8Array to convert
7
- * @returns The converted string
8
- */
9
- function arrayBufferToString(buffer) {
10
- const bytes = buffer instanceof Uint8Array ? buffer : new Uint8Array(buffer);
11
- const len = bytes.byteLength;
12
- if (len < 65535) return String.fromCharCode.apply(null, bytes);
13
- let binary = "";
14
- for (let i = 0; i < len; i++) binary += String.fromCharCode(bytes[i]);
15
- return binary;
16
- }
17
-
18
- //#endregion
19
- exports.arrayBufferToString = arrayBufferToString;
@@ -1,19 +0,0 @@
1
- //#region ../convert/src/array-buffer-to-string.ts
2
- /**
3
- * Convert an ArrayBuffer or Uint8Array to a string
4
- *
5
- * @param buffer - The ArrayBuffer or Uint8Array to convert
6
- * @returns The converted string
7
- */
8
- function arrayBufferToString(buffer) {
9
- const bytes = buffer instanceof Uint8Array ? buffer : new Uint8Array(buffer);
10
- const len = bytes.byteLength;
11
- if (len < 65535) return String.fromCharCode.apply(null, bytes);
12
- let binary = "";
13
- for (let i = 0; i < len; i++) binary += String.fromCharCode(bytes[i]);
14
- return binary;
15
- }
16
-
17
- //#endregion
18
- export { arrayBufferToString };
19
- //# sourceMappingURL=array-buffer-to-string.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"array-buffer-to-string.mjs","names":[],"sources":["../../../../convert/src/array-buffer-to-string.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\n/**\n * Convert an ArrayBuffer or Uint8Array to a string\n *\n * @param buffer - The ArrayBuffer or Uint8Array to convert\n * @returns The converted string\n */\nexport function arrayBufferToString(\n buffer: ArrayBuffer | ArrayBufferLike | Uint8Array\n): string {\n const bytes =\n buffer instanceof Uint8Array\n ? buffer\n : new Uint8Array(buffer as ArrayBufferLike);\n const len = bytes.byteLength;\n if (len < 65535) {\n return String.fromCharCode.apply(null, bytes as unknown as number[]);\n }\n let binary = \"\";\n for (let i = 0; i < len; i++) {\n binary += String.fromCharCode(bytes[i]!);\n }\n return binary;\n}\n"],"mappings":";;;;;;;AAwBA,SAAgB,oBACd,QACQ;CACR,MAAM,QACJ,kBAAkB,aACd,SACA,IAAI,WAAW,OAA0B;CAC/C,MAAM,MAAM,MAAM;AAClB,KAAI,MAAM,MACR,QAAO,OAAO,aAAa,MAAM,MAAM,MAA6B;CAEtE,IAAI,SAAS;AACb,MAAK,IAAI,IAAI,GAAG,IAAI,KAAK,IACvB,WAAU,OAAO,aAAa,MAAM,GAAI;AAE1C,QAAO"}
@@ -1,7 +0,0 @@
1
- const require_array_buffer_to_string = require('./array-buffer-to-string.cjs');
2
- require('./parse-type-definition.cjs');
3
- const require_string_to_uint8_array = require('./string-to-uint8-array.cjs');
4
- const require_string_to_utf8_array = require('./string-to-utf8-array.cjs');
5
- const require_uint8_array_to_stream = require('./uint8-array-to-stream.cjs');
6
- const require_uint8_array_to_string = require('./uint8-array-to-string.cjs');
7
- const require_utf8_array_to_string = require('./utf8-array-to-string.cjs');
@@ -1,9 +0,0 @@
1
- import { arrayBufferToString } from "./array-buffer-to-string.mjs";
2
- import "./parse-type-definition.mjs";
3
- import { base64StringToUint8Array, stringToUint8Array } from "./string-to-uint8-array.mjs";
4
- import { stringToUtf8Array } from "./string-to-utf8-array.mjs";
5
- import { concatUint8Array } from "./uint8-array-to-stream.mjs";
6
- import { uint8ArrayToString } from "./uint8-array-to-string.mjs";
7
- import { utf8ArrayToString } from "./utf8-array-to-string.mjs";
8
-
9
- export { };
@@ -1 +0,0 @@
1
- require('../../type-checks/src/index.cjs');
@@ -1,3 +0,0 @@
1
- import "../../type-checks/src/index.mjs";
2
-
3
- export { };
@@ -1,24 +0,0 @@
1
-
2
- //#region ../convert/src/string-to-uint8-array.ts
3
- /**
4
- * Convert a string to Uint8Array
5
- *
6
- * @param text - The text to convert
7
- * @returns The converted Uint8Array
8
- */
9
- function stringToUint8Array(text) {
10
- return Uint8Array.from([...encodeURIComponent(text)].map((letter) => letter.codePointAt(0)));
11
- }
12
- /**
13
- * Convert a base64 string to a Uint8Array
14
- *
15
- * @param data - The base64 string to convert
16
- * @returns The converted Uint8Array
17
- */
18
- function base64StringToUint8Array(data) {
19
- return stringToUint8Array(atob(data));
20
- }
21
-
22
- //#endregion
23
- exports.base64StringToUint8Array = base64StringToUint8Array;
24
- exports.stringToUint8Array = stringToUint8Array;
@@ -1,23 +0,0 @@
1
- //#region ../convert/src/string-to-uint8-array.ts
2
- /**
3
- * Convert a string to Uint8Array
4
- *
5
- * @param text - The text to convert
6
- * @returns The converted Uint8Array
7
- */
8
- function stringToUint8Array(text) {
9
- return Uint8Array.from([...encodeURIComponent(text)].map((letter) => letter.codePointAt(0)));
10
- }
11
- /**
12
- * Convert a base64 string to a Uint8Array
13
- *
14
- * @param data - The base64 string to convert
15
- * @returns The converted Uint8Array
16
- */
17
- function base64StringToUint8Array(data) {
18
- return stringToUint8Array(atob(data));
19
- }
20
-
21
- //#endregion
22
- export { base64StringToUint8Array, stringToUint8Array };
23
- //# sourceMappingURL=string-to-uint8-array.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"string-to-uint8-array.mjs","names":[],"sources":["../../../../convert/src/string-to-uint8-array.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\n/**\n * Convert a string to Uint8Array\n *\n * @param text - The text to convert\n * @returns The converted Uint8Array\n */\nexport function stringToUint8Array(text: string): Uint8Array {\n return Uint8Array.from(\n [...encodeURIComponent(text)].map(letter => letter.codePointAt(0)!)\n );\n}\n\n/**\n * Convert a binary string to Uint8Array\n *\n * @param binary - The binary string to convert\n * @returns The converted Uint8Array\n */\nexport function binaryStringToUint8Array(binary: string): Uint8Array {\n const len = binary.length;\n const arr = new Uint8Array(len);\n for (let i = 0; i < len; i++) {\n arr[i] = binary.charCodeAt(i);\n }\n return arr;\n}\n\n/**\n * Convert a base64 string to a Uint8Array\n *\n * @param data - The base64 string to convert\n * @returns The converted Uint8Array\n */\nexport function base64StringToUint8Array(data: string): Uint8Array {\n return stringToUint8Array(atob(data));\n}\n"],"mappings":";;;;;;;AAwBA,SAAgB,mBAAmB,MAA0B;AAC3D,QAAO,WAAW,KAChB,CAAC,GAAG,mBAAmB,KAAK,CAAC,CAAC,KAAI,WAAU,OAAO,YAAY,EAAE,CAAE,CACpE;;;;;;;;AAwBH,SAAgB,yBAAyB,MAA0B;AACjE,QAAO,mBAAmB,KAAK,KAAK,CAAC"}
@@ -1,15 +0,0 @@
1
-
2
- //#region ../convert/src/string-to-utf8-array.ts
3
- const encoder = new TextEncoder();
4
- /**
5
- * Convert a string to a utf-8 array
6
- *
7
- * @param input - The string to convert
8
- * @returns The converted utf-8 array
9
- */
10
- function stringToUtf8Array(input) {
11
- return encoder.encode(input);
12
- }
13
-
14
- //#endregion
15
- exports.stringToUtf8Array = stringToUtf8Array;
@@ -1,15 +0,0 @@
1
- //#region ../convert/src/string-to-utf8-array.ts
2
- const encoder = new TextEncoder();
3
- /**
4
- * Convert a string to a utf-8 array
5
- *
6
- * @param input - The string to convert
7
- * @returns The converted utf-8 array
8
- */
9
- function stringToUtf8Array(input) {
10
- return encoder.encode(input);
11
- }
12
-
13
- //#endregion
14
- export { stringToUtf8Array };
15
- //# sourceMappingURL=string-to-utf8-array.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"string-to-utf8-array.mjs","names":[],"sources":["../../../../convert/src/string-to-utf8-array.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nconst encoder = new TextEncoder();\n\n/**\n * Convert a string to a utf-8 array\n *\n * @param input - The string to convert\n * @returns The converted utf-8 array\n */\nexport function stringToUtf8Array(input: string): Uint8Array {\n return encoder.encode(input);\n}\n"],"mappings":";AAkBA,MAAM,UAAU,IAAI,aAAa;;;;;;;AAQjC,SAAgB,kBAAkB,OAA2B;AAC3D,QAAO,QAAQ,OAAO,MAAM"}