@fedify/fedify 1.6.0-dev.810 → 1.6.0-dev.812

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 (42) hide show
  1. package/CHANGES.md +2 -0
  2. package/esm/deno.js +2 -5
  3. package/esm/federation/collection.js +1 -1
  4. package/esm/runtime/docloader.js +14 -7
  5. package/esm/runtime/key.js +7 -6
  6. package/esm/sig/http.js +37 -3
  7. package/esm/sig/ld.js +2 -2
  8. package/esm/sig/proof.js +1 -1
  9. package/esm/vocab/vocab.js +176 -176
  10. package/package.json +3 -2
  11. package/types/deno.d.ts +1 -4
  12. package/types/runtime/docloader.d.ts.map +1 -1
  13. package/types/runtime/key.d.ts.map +1 -1
  14. package/types/sig/http.d.ts +15 -0
  15. package/types/sig/http.d.ts.map +1 -1
  16. package/esm/deps/jsr.io/@david/which-runtime/0.2.1/mod.js +0 -10
  17. package/esm/deps/jsr.io/@std/bytes/1.0.6/_types.js +0 -2
  18. package/esm/deps/jsr.io/@std/bytes/1.0.6/concat.js +0 -32
  19. package/esm/deps/jsr.io/@std/crypto/1.0.5/timing_safe_equal.js +0 -55
  20. package/esm/deps/jsr.io/@std/encoding/1.0.7/_types.js +0 -2
  21. package/esm/deps/jsr.io/@std/encoding/1.0.7/_validate_binary_like.js +0 -26
  22. package/esm/deps/jsr.io/@std/encoding/1.0.7/base64.js +0 -163
  23. package/esm/deps/jsr.io/@std/encoding/1.0.7/base64url.js +0 -81
  24. package/esm/deps/jsr.io/@std/encoding/1.0.7/hex.js +0 -109
  25. package/types/deps/jsr.io/@david/which-runtime/0.2.1/mod.d.ts +0 -3
  26. package/types/deps/jsr.io/@david/which-runtime/0.2.1/mod.d.ts.map +0 -1
  27. package/types/deps/jsr.io/@std/bytes/1.0.6/_types.d.ts +0 -9
  28. package/types/deps/jsr.io/@std/bytes/1.0.6/_types.d.ts.map +0 -1
  29. package/types/deps/jsr.io/@std/bytes/1.0.6/concat.d.ts +0 -21
  30. package/types/deps/jsr.io/@std/bytes/1.0.6/concat.d.ts.map +0 -1
  31. package/types/deps/jsr.io/@std/crypto/1.0.5/timing_safe_equal.d.ts +0 -34
  32. package/types/deps/jsr.io/@std/crypto/1.0.5/timing_safe_equal.d.ts.map +0 -1
  33. package/types/deps/jsr.io/@std/encoding/1.0.7/_types.d.ts +0 -9
  34. package/types/deps/jsr.io/@std/encoding/1.0.7/_types.d.ts.map +0 -1
  35. package/types/deps/jsr.io/@std/encoding/1.0.7/_validate_binary_like.d.ts +0 -2
  36. package/types/deps/jsr.io/@std/encoding/1.0.7/_validate_binary_like.d.ts.map +0 -1
  37. package/types/deps/jsr.io/@std/encoding/1.0.7/base64.d.ts +0 -40
  38. package/types/deps/jsr.io/@std/encoding/1.0.7/base64.d.ts.map +0 -1
  39. package/types/deps/jsr.io/@std/encoding/1.0.7/base64url.d.ts +0 -40
  40. package/types/deps/jsr.io/@std/encoding/1.0.7/base64url.d.ts.map +0 -1
  41. package/types/deps/jsr.io/@std/encoding/1.0.7/hex.d.ts +0 -39
  42. package/types/deps/jsr.io/@std/encoding/1.0.7/hex.d.ts.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fedify/fedify",
3
- "version": "1.6.0-dev.810+66f5c864",
3
+ "version": "1.6.0-dev.812+f522d042",
4
4
  "description": "An ActivityPub server framework",
5
5
  "keywords": [
6
6
  "ActivityPub",
@@ -90,7 +90,7 @@
90
90
  ],
91
91
  "engines": {
92
92
  "deno": ">=2.0.0",
93
- "node": ">=20.0.0",
93
+ "node": ">=22.0.0",
94
94
  "bun": ">=1.1.0"
95
95
  },
96
96
  "dependencies": {
@@ -101,6 +101,7 @@
101
101
  "@opentelemetry/semantic-conventions": "^1.27.0",
102
102
  "@phensley/language-tag": "^1.9.0",
103
103
  "asn1js": "^3.0.5",
104
+ "byte-encodings": "^1.0.11",
104
105
  "json-canon": "^1.0.1",
105
106
  "jsonld": "^8.3.2",
106
107
  "multicodec": "^3.2.1",
package/types/deno.d.ts CHANGED
@@ -18,7 +18,6 @@ declare namespace _default {
18
18
  };
19
19
  let imports: {
20
20
  "@cfworker/json-schema": string;
21
- "@david/which-runtime": string;
22
21
  "@deno/dnt": string;
23
22
  "@es-toolkit/es-toolkit": string;
24
23
  "@hugoalh/http-header-link": string;
@@ -26,14 +25,12 @@ declare namespace _default {
26
25
  "@opentelemetry/semantic-conventions": string;
27
26
  "@phensley/language-tag": string;
28
27
  "@std/assert": string;
29
- "@std/bytes": string;
30
- "@std/crypto": string;
31
- "@std/encoding": string;
32
28
  "@std/http": string;
33
29
  "@std/testing": string;
34
30
  "@std/url": string;
35
31
  "@std/yaml": string;
36
32
  asn1js: string;
33
+ "byte-encodings": string;
37
34
  "fast-check": string;
38
35
  "json-canon": string;
39
36
  jsonld: string;
@@ -1 +1 @@
1
- {"version":3,"file":"docloader.d.ts","sourceRoot":"","sources":["../../src/runtime/docloader.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,kBAAkB,CAAC;AAI5C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAGzD,OAAO,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAEL,KAAK,mCAAmC,EACzC,MAAM,gBAAgB,CAAC;AAOxB;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAE1B;;OAEG;IACH,QAAQ,EAAE,OAAO,CAAC;IAElB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,cAAc,CAAC,CAAC;AAEtE;;;;;GAKG;AACH,MAAM,MAAM,qBAAqB,GAAG,CAClC,OAAO,CAAC,EAAE,4BAA4B,KACnC,cAAc,CAAC;AAEpB;;;;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":"","sources":["../../src/runtime/key.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,kBAAkB,CAAC;AAuB5C;;;;;;GAMG;AACH,wBAAsB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,CAqBxE;AAED;;;;;;GAMG;AACH,wBAAsB,UAAU,CAAC,GAAG,EAAE,OAAO,CAAC,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC,CAMxE;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,CAInE;AAID;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,CAEjE;AAED;;;;;;;;GAQG;AACH,wBAAsB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,CA8BhF;AAED;;;;;;;;GAQG;AACH,wBAAsB,kBAAkB,CAAC,GAAG,EAAE,OAAO,CAAC,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC,CAqChF"}
1
+ {"version":3,"file":"key.d.ts","sourceRoot":"","sources":["../../src/runtime/key.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,kBAAkB,CAAC;AAsB5C;;;;;;GAMG;AACH,wBAAsB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,CAqBxE;AAED;;;;;;GAMG;AACH,wBAAsB,UAAU,CAAC,GAAG,EAAE,OAAO,CAAC,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC,CAMxE;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,CAInE;AAID;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,CAEjE;AAED;;;;;;;;GAQG;AACH,wBAAsB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,CA8BhF;AAED;;;;;;;;GAQG;AACH,wBAAsB,kBAAkB,CAAC,GAAG,EAAE,OAAO,CAAC,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC,CAuChF"}
@@ -203,4 +203,19 @@ export declare function doubleKnock(request: Request, identity: {
203
203
  keyId: URL;
204
204
  privateKey: dntShim.CryptoKey;
205
205
  }, options?: DoubleKnockOptions): Promise<Response>;
206
+ /**
207
+ * Performs a timing-safe equality comparison between two `Uint8Array` values.
208
+ *
209
+ * This function is designed to take a constant amount of time to execute,
210
+ * dependent only on the length of the longer of the two arrays,
211
+ * regardless of where the first difference in bytes occurs. This helps
212
+ * prevent timing attacks.
213
+ *
214
+ * @param a The first bytes.
215
+ * @param b The second bytes.
216
+ * @returns `true` if the arrays are of the same length and contain the same
217
+ * bytes, `false` otherwise.
218
+ * @since 1.6.0
219
+ */
220
+ export declare function timingSafeEqual(a: Uint8Array, b: Uint8Array): boolean;
206
221
  //# sourceMappingURL=http.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../src/sig/http.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,kBAAkB,CAAC;AAE5C,OAAO,EAIL,KAAK,cAAc,EACpB,MAAM,oBAAoB,CAAC;AAgB5B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAY,KAAK,QAAQ,EAAqB,MAAM,UAAU,CAAC;AAEtE;;;GAGG;AACH,MAAM,MAAM,yBAAyB;AACnC;;;GAGG;AACD,iCAAiC;AACnC;;;G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jC;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,aAAa,CACjC,OAAO,EAAE,OAAO,EAChB,OAAO,GAAE,oBAAyB,GACjC,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC,CA6ClC;AAsjBD;;;;;;GAMG;AACH,MAAM,WAAW,mCAAmC;IAClD;;;;OAIG;IACH,aAAa,CACX,MAAM,EAAE,MAAM,GACb,yBAAyB,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAAC;IAElE;;;;OAIG;IACH,YAAY,CACV,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,yBAAyB,GAC9B,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACzB;AAED;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,cAAc,CAAC,EAAE,mCAAmC,CAAC;IAErD;;;OAGG;IACH,GAAG,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAEjC;;;OAGG;IACH,cAAc,CAAC,EAAE,cAAc,CAAC;CACjC;AAED;;;;;;;;;GASG;AACH,wBAAsB,WAAW,CAC/B,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE;IAAE,KAAK,EAAE,GAAG,CAAC;IAAC,UAAU,EAAE,OAAO,CAAC,SAAS,CAAA;CAAE,EACvD,OAAO,GAAE,kBAAuB,GAC/B,OAAO,CAAC,QAAQ,CAAC,CA8FnB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,UAAU,GAAG,OAAO,CAuBrE"}
@@ -1,10 +0,0 @@
1
- const inner = {
2
- // dnt-shim-ignore
3
- // deno-lint-ignore no-explicit-any
4
- isMaybeNode: globalThis.process?.versions?.node != null,
5
- // dnt-shim-ignore
6
- // deno-lint-ignore no-explicit-any
7
- isDeno: globalThis.Deno?.version?.deno != null,
8
- };
9
- export const isNode = inner.isMaybeNode && !inner.isDeno;
10
- export const isDeno = inner.isDeno;
@@ -1,2 +0,0 @@
1
- // Copyright 2018-2025 the Deno authors. MIT license.
2
- export {};
@@ -1,32 +0,0 @@
1
- // Copyright 2018-2025 the Deno authors. MIT license.
2
- // This module is browser compatible.
3
- /**
4
- * Concatenate an array of byte slices into a single slice.
5
- *
6
- * @param buffers Array of byte slices to concatenate.
7
- * @returns A new byte slice containing all the input slices concatenated.
8
- *
9
- * @example Basic usage
10
- * ```ts
11
- * import { concat } from "@std/bytes/concat";
12
- * import { assertEquals } from "@std/assert";
13
- *
14
- * const a = new Uint8Array([0, 1, 2]);
15
- * const b = new Uint8Array([3, 4, 5]);
16
- *
17
- * assertEquals(concat([a, b]), new Uint8Array([0, 1, 2, 3, 4, 5]));
18
- * ```
19
- */
20
- export function concat(buffers) {
21
- let length = 0;
22
- for (const buffer of buffers) {
23
- length += buffer.length;
24
- }
25
- const output = new Uint8Array(length);
26
- let index = 0;
27
- for (const buffer of buffers) {
28
- output.set(buffer, index);
29
- index += buffer.length;
30
- }
31
- return output;
32
- }
@@ -1,55 +0,0 @@
1
- // Copyright 2018-2025 the Deno authors. MIT license.
2
- // This module is browser compatible.
3
- function toDataView(value) {
4
- if (value instanceof DataView) {
5
- return value;
6
- }
7
- return ArrayBuffer.isView(value)
8
- ? new DataView(value.buffer, value.byteOffset, value.byteLength)
9
- : new DataView(value);
10
- }
11
- /**
12
- * When checking the values of cryptographic hashes are equal, default
13
- * comparisons can be susceptible to timing based attacks, where attacker is
14
- * able to find out information about the host system by repeatedly checking
15
- * response times to equality comparisons of values.
16
- *
17
- * It is likely some form of timing safe equality will make its way to the
18
- * WebCrypto standard (see:
19
- * {@link https://github.com/w3c/webcrypto/issues/270 | w3c/webcrypto#270}), but until
20
- * that time, `timingSafeEqual()` is provided:
21
- *
22
- * @example Usage
23
- * ```ts
24
- * import { timingSafeEqual } from "@std/crypto/timing-safe-equal";
25
- * import { assert } from "@std/assert";
26
- *
27
- * const a = await crypto.subtle.digest(
28
- * "SHA-384",
29
- * new TextEncoder().encode("hello world"),
30
- * );
31
- * const b = await crypto.subtle.digest(
32
- * "SHA-384",
33
- * new TextEncoder().encode("hello world"),
34
- * );
35
- *
36
- * assert(timingSafeEqual(a, b));
37
- * ```
38
- *
39
- * @param a The first value to compare.
40
- * @param b The second value to compare.
41
- * @returns `true` if the values are equal, otherwise `false`.
42
- */
43
- export function timingSafeEqual(a, b) {
44
- if (a.byteLength !== b.byteLength)
45
- return false;
46
- const dataViewA = toDataView(a);
47
- const dataViewB = toDataView(b);
48
- const length = a.byteLength;
49
- let out = 0;
50
- let i = -1;
51
- while (++i < length) {
52
- out |= dataViewA.getUint8(i) ^ dataViewB.getUint8(i);
53
- }
54
- return out === 0;
55
- }
@@ -1,2 +0,0 @@
1
- // Copyright 2018-2025 the Deno authors. MIT license.
2
- export {};
@@ -1,26 +0,0 @@
1
- // Copyright 2018-2025 the Deno authors. MIT license.
2
- const encoder = new TextEncoder();
3
- function getTypeName(value) {
4
- const type = typeof value;
5
- if (type !== "object") {
6
- return type;
7
- }
8
- else if (value === null) {
9
- return "null";
10
- }
11
- else {
12
- return value?.constructor?.name ?? "object";
13
- }
14
- }
15
- export function validateBinaryLike(source) {
16
- if (typeof source === "string") {
17
- return encoder.encode(source);
18
- }
19
- else if (source instanceof Uint8Array) {
20
- return source;
21
- }
22
- else if (source instanceof ArrayBuffer) {
23
- return new Uint8Array(source);
24
- }
25
- throw new TypeError(`Cannot validate the input as it must be a Uint8Array, a string, or an ArrayBuffer: received a value of the type ${getTypeName(source)}`);
26
- }
@@ -1,163 +0,0 @@
1
- // Copyright 2018-2025 the Deno authors. MIT license.
2
- // This module is browser compatible.
3
- /**
4
- * Utilities for
5
- * {@link https://www.rfc-editor.org/rfc/rfc4648.html#section-4 | base64}
6
- * encoding and decoding.
7
- *
8
- * ```ts
9
- * import {
10
- * encodeBase64,
11
- * decodeBase64,
12
- * } from "@std/encoding/base64";
13
- * import { assertEquals } from "@std/assert";
14
- *
15
- * const foobar = new TextEncoder().encode("foobar");
16
- *
17
- * assertEquals(encodeBase64(foobar), "Zm9vYmFy");
18
- * assertEquals(decodeBase64("Zm9vYmFy"), foobar);
19
- * ```
20
- *
21
- * @module
22
- */
23
- import { validateBinaryLike } from "./_validate_binary_like.js";
24
- const base64abc = [
25
- "A",
26
- "B",
27
- "C",
28
- "D",
29
- "E",
30
- "F",
31
- "G",
32
- "H",
33
- "I",
34
- "J",
35
- "K",
36
- "L",
37
- "M",
38
- "N",
39
- "O",
40
- "P",
41
- "Q",
42
- "R",
43
- "S",
44
- "T",
45
- "U",
46
- "V",
47
- "W",
48
- "X",
49
- "Y",
50
- "Z",
51
- "a",
52
- "b",
53
- "c",
54
- "d",
55
- "e",
56
- "f",
57
- "g",
58
- "h",
59
- "i",
60
- "j",
61
- "k",
62
- "l",
63
- "m",
64
- "n",
65
- "o",
66
- "p",
67
- "q",
68
- "r",
69
- "s",
70
- "t",
71
- "u",
72
- "v",
73
- "w",
74
- "x",
75
- "y",
76
- "z",
77
- "0",
78
- "1",
79
- "2",
80
- "3",
81
- "4",
82
- "5",
83
- "6",
84
- "7",
85
- "8",
86
- "9",
87
- "+",
88
- "/",
89
- ];
90
- /**
91
- * Converts data into a base64-encoded string.
92
- *
93
- * @see {@link https://www.rfc-editor.org/rfc/rfc4648.html#section-4}
94
- *
95
- * @param data The data to encode.
96
- * @returns The base64-encoded string.
97
- *
98
- * @example Usage
99
- * ```ts
100
- * import { encodeBase64 } from "@std/encoding/base64";
101
- * import { assertEquals } from "@std/assert";
102
- *
103
- * assertEquals(encodeBase64("foobar"), "Zm9vYmFy");
104
- * ```
105
- */
106
- export function encodeBase64(data) {
107
- // CREDIT: https://gist.github.com/enepomnyaschih/72c423f727d395eeaa09697058238727
108
- const uint8 = validateBinaryLike(data);
109
- let result = "";
110
- let i;
111
- const l = uint8.length;
112
- for (i = 2; i < l; i += 3) {
113
- result += base64abc[(uint8[i - 2]) >> 2];
114
- result += base64abc[(((uint8[i - 2]) & 0x03) << 4) |
115
- ((uint8[i - 1]) >> 4)];
116
- result += base64abc[(((uint8[i - 1]) & 0x0f) << 2) |
117
- ((uint8[i]) >> 6)];
118
- result += base64abc[(uint8[i]) & 0x3f];
119
- }
120
- if (i === l + 1) {
121
- // 1 octet yet to write
122
- result += base64abc[(uint8[i - 2]) >> 2];
123
- result += base64abc[((uint8[i - 2]) & 0x03) << 4];
124
- result += "==";
125
- }
126
- if (i === l) {
127
- // 2 octets yet to write
128
- result += base64abc[(uint8[i - 2]) >> 2];
129
- result += base64abc[(((uint8[i - 2]) & 0x03) << 4) |
130
- ((uint8[i - 1]) >> 4)];
131
- result += base64abc[((uint8[i - 1]) & 0x0f) << 2];
132
- result += "=";
133
- }
134
- return result;
135
- }
136
- /**
137
- * Decodes a base64-encoded string.
138
- *
139
- * @see {@link https://www.rfc-editor.org/rfc/rfc4648.html#section-4}
140
- *
141
- * @param b64 The base64-encoded string to decode.
142
- * @returns The decoded data.
143
- *
144
- * @example Usage
145
- * ```ts
146
- * import { decodeBase64 } from "@std/encoding/base64";
147
- * import { assertEquals } from "@std/assert";
148
- *
149
- * assertEquals(
150
- * decodeBase64("Zm9vYmFy"),
151
- * new TextEncoder().encode("foobar")
152
- * );
153
- * ```
154
- */
155
- export function decodeBase64(b64) {
156
- const binString = atob(b64);
157
- const size = binString.length;
158
- const bytes = new Uint8Array(size);
159
- for (let i = 0; i < size; i++) {
160
- bytes[i] = binString.charCodeAt(i);
161
- }
162
- return bytes;
163
- }
@@ -1,81 +0,0 @@
1
- // Copyright 2018-2025 the Deno authors. MIT license.
2
- // This module is browser compatible.
3
- /**
4
- * Utilities for
5
- * {@link https://www.rfc-editor.org/rfc/rfc4648.html#section-5 | base64url}
6
- * encoding and decoding.
7
- *
8
- * @module
9
- */
10
- import * as base64 from "./base64.js";
11
- /**
12
- * Some variants allow or require omitting the padding '=' signs:
13
- * https://en.wikipedia.org/wiki/Base64#The_URL_applications
14
- *
15
- * @param base64url
16
- */
17
- function addPaddingToBase64url(base64url) {
18
- if (base64url.length % 4 === 2)
19
- return base64url + "==";
20
- if (base64url.length % 4 === 3)
21
- return base64url + "=";
22
- if (base64url.length % 4 === 1) {
23
- throw new TypeError("Illegal base64url string");
24
- }
25
- return base64url;
26
- }
27
- function convertBase64urlToBase64(b64url) {
28
- if (!/^[-_A-Z0-9]*?={0,2}$/i.test(b64url)) {
29
- // Contains characters not part of base64url spec.
30
- throw new TypeError("Failed to decode base64url: invalid character");
31
- }
32
- return addPaddingToBase64url(b64url).replace(/\-/g, "+").replace(/_/g, "/");
33
- }
34
- function convertBase64ToBase64url(b64) {
35
- return b64.endsWith("=")
36
- ? b64.endsWith("==")
37
- ? b64.replace(/\+/g, "-").replace(/\//g, "_").slice(0, -2)
38
- : b64.replace(/\+/g, "-").replace(/\//g, "_").slice(0, -1)
39
- : b64.replace(/\+/g, "-").replace(/\//g, "_");
40
- }
41
- /**
42
- * Convert data into a base64url-encoded string.
43
- *
44
- * @see {@link https://www.rfc-editor.org/rfc/rfc4648.html#section-5}
45
- *
46
- * @param data The data to encode.
47
- * @returns The base64url-encoded string.
48
- *
49
- * @example Usage
50
- * ```ts
51
- * import { encodeBase64Url } from "@std/encoding/base64url";
52
- * import { assertEquals } from "@std/assert";
53
- *
54
- * assertEquals(encodeBase64Url("foobar"), "Zm9vYmFy");
55
- * ```
56
- */
57
- export function encodeBase64Url(data) {
58
- return convertBase64ToBase64url(base64.encodeBase64(data));
59
- }
60
- /**
61
- * Decodes a given base64url-encoded string.
62
- *
63
- * @see {@link https://www.rfc-editor.org/rfc/rfc4648.html#section-5}
64
- *
65
- * @param b64url The base64url-encoded string to decode.
66
- * @returns The decoded data.
67
- *
68
- * @example Usage
69
- * ```ts
70
- * import { decodeBase64Url } from "@std/encoding/base64url";
71
- * import { assertEquals } from "@std/assert";
72
- *
73
- * assertEquals(
74
- * decodeBase64Url("Zm9vYmFy"),
75
- * new TextEncoder().encode("foobar")
76
- * );
77
- * ```
78
- */
79
- export function decodeBase64Url(b64url) {
80
- return base64.decodeBase64(convertBase64urlToBase64(b64url));
81
- }
@@ -1,109 +0,0 @@
1
- // Copyright 2009 The Go Authors. All rights reserved.
2
- // https://github.com/golang/go/blob/master/LICENSE
3
- // Copyright 2018-2025 the Deno authors. MIT license.
4
- // This module is browser compatible.
5
- /**
6
- * Port of the Go
7
- * {@link https://github.com/golang/go/blob/go1.12.5/src/encoding/hex/hex.go | encoding/hex}
8
- * library.
9
- *
10
- * ```ts
11
- * import {
12
- * decodeHex,
13
- * encodeHex,
14
- * } from "@std/encoding/hex";
15
- * import { assertEquals } from "@std/assert";
16
- *
17
- * assertEquals(encodeHex("abc"), "616263");
18
- *
19
- * assertEquals(
20
- * decodeHex("616263"),
21
- * new TextEncoder().encode("abc"),
22
- * );
23
- * ```
24
- *
25
- * @module
26
- */
27
- import { validateBinaryLike } from "./_validate_binary_like.js";
28
- const hexTable = new TextEncoder().encode("0123456789abcdef");
29
- const textEncoder = new TextEncoder();
30
- const textDecoder = new TextDecoder();
31
- function errInvalidByte(byte) {
32
- return new TypeError(`Invalid byte '${String.fromCharCode(byte)}'`);
33
- }
34
- function errLength(len) {
35
- return new RangeError(`Cannot decode the hex string as the input length should be even: length is ${len}`);
36
- }
37
- /** Converts a hex character into its value. */
38
- function fromHexChar(byte) {
39
- // '0' <= byte && byte <= '9'
40
- if (48 <= byte && byte <= 57)
41
- return byte - 48;
42
- // 'a' <= byte && byte <= 'f'
43
- if (97 <= byte && byte <= 102)
44
- return byte - 97 + 10;
45
- // 'A' <= byte && byte <= 'F'
46
- if (65 <= byte && byte <= 70)
47
- return byte - 65 + 10;
48
- throw errInvalidByte(byte);
49
- }
50
- /**
51
- * Converts data into a hex-encoded string.
52
- *
53
- * @param src The data to encode.
54
- *
55
- * @returns The hex-encoded string.
56
- *
57
- * @example Usage
58
- * ```ts
59
- * import { encodeHex } from "@std/encoding/hex";
60
- * import { assertEquals } from "@std/assert";
61
- *
62
- * assertEquals(encodeHex("abc"), "616263");
63
- * ```
64
- */
65
- export function encodeHex(src) {
66
- const u8 = validateBinaryLike(src);
67
- const dst = new Uint8Array(u8.length * 2);
68
- for (let i = 0; i < u8.length; i++) {
69
- const v = u8[i];
70
- dst[i * 2] = hexTable[v >> 4];
71
- dst[i * 2 + 1] = hexTable[v & 0x0f];
72
- }
73
- return textDecoder.decode(dst);
74
- }
75
- /**
76
- * Decodes the given hex-encoded string. If the input is malformed, an error is
77
- * thrown.
78
- *
79
- * @param src The hex-encoded string to decode.
80
- *
81
- * @returns The decoded data.
82
- *
83
- * @example Usage
84
- * ```ts
85
- * import { decodeHex } from "@std/encoding/hex";
86
- * import { assertEquals } from "@std/assert";
87
- *
88
- * assertEquals(
89
- * decodeHex("616263"),
90
- * new TextEncoder().encode("abc"),
91
- * );
92
- * ```
93
- */
94
- export function decodeHex(src) {
95
- const u8 = textEncoder.encode(src);
96
- const dst = new Uint8Array(u8.length / 2);
97
- for (let i = 0; i < dst.length; i++) {
98
- const a = fromHexChar(u8[i * 2]);
99
- const b = fromHexChar(u8[i * 2 + 1]);
100
- dst[i] = (a << 4) | b;
101
- }
102
- if (u8.length % 2 === 1) {
103
- // Check for invalid char before reporting bad length,
104
- // since the invalid char (if present) is an earlier problem.
105
- fromHexChar(u8[dst.length * 2]);
106
- throw errLength(u8.length);
107
- }
108
- return dst;
109
- }
@@ -1,3 +0,0 @@
1
- export declare const isNode: boolean;
2
- export declare const isDeno: boolean;
3
- //# sourceMappingURL=mod.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@david/which-runtime/0.2.1/mod.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,MAAM,EAAE,OAA4C,CAAC;AAClE,eAAO,MAAM,MAAM,EAAE,OAAsB,CAAC"}
@@ -1,9 +0,0 @@
1
- /**
2
- * Proxy type of {@code Uint8Array<ArrayBuffer} or {@code Uint8Array} in TypeScript 5.7 or below respectively.
3
- *
4
- * This type is internal utility type and should not be used directly.
5
- *
6
- * @internal @private
7
- */
8
- export type Uint8Array_ = ReturnType<Uint8Array["slice"]>;
9
- //# sourceMappingURL=_types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"_types.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/bytes/1.0.6/_types.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AAEH,MAAM,MAAM,WAAW,GAAG,UAAU,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC"}
@@ -1,21 +0,0 @@
1
- import type { Uint8Array_ } from "./_types.js";
2
- export type { Uint8Array_ };
3
- /**
4
- * Concatenate an array of byte slices into a single slice.
5
- *
6
- * @param buffers Array of byte slices to concatenate.
7
- * @returns A new byte slice containing all the input slices concatenated.
8
- *
9
- * @example Basic usage
10
- * ```ts
11
- * import { concat } from "@std/bytes/concat";
12
- * import { assertEquals } from "@std/assert";
13
- *
14
- * const a = new Uint8Array([0, 1, 2]);
15
- * const b = new Uint8Array([3, 4, 5]);
16
- *
17
- * assertEquals(concat([a, b]), new Uint8Array([0, 1, 2, 3, 4, 5]));
18
- * ```
19
- */
20
- export declare function concat(buffers: readonly Uint8Array[]): Uint8Array_;
21
- //# sourceMappingURL=concat.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"concat.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/bytes/1.0.6/concat.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,YAAY,EAAE,WAAW,EAAE,CAAC;AAE5B;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,MAAM,CAAC,OAAO,EAAE,SAAS,UAAU,EAAE,GAAG,WAAW,CAalE"}