@flickfyi/flkr 0.0.0 → 0.0.118
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/node_modules/@flickfyi/core/dist/index.js +2 -2
- package/node_modules/@flickfyi/core/package.json +2 -2
- package/node_modules/@flickfyi/core/src/generated-types.d.ts +1 -1
- package/node_modules/@flickfyi/core/tsgo.bun.lock +9 -9
- package/node_modules/@flickfyi/core/tsgo.package.json +2 -2
- package/node_modules/@flickfyi/http-message-sig/dist/index.js +11 -11
- package/node_modules/@flickfyi/identity/dist/{base-B-urclbM.js → base-B1Vicu5t.js} +1 -1
- package/node_modules/@flickfyi/identity/dist/biscuit.js +1 -1
- package/node_modules/@flickfyi/identity/dist/{curve-CpcHwjN8.js → curve-BVH9bh0Y.js} +7 -7
- package/node_modules/@flickfyi/identity/dist/{cwt-DySP8lzM.js → cwt-CfubTfiF.js} +25 -25
- package/node_modules/@flickfyi/identity/dist/cwt.js +1 -1
- package/node_modules/@flickfyi/identity/dist/index.js +3 -3
- package/node_modules/@flickfyi/identity/dist/{nist-DAZq4YJ7.js → nist-C8Poq91M.js} +4 -4
- package/node_modules/@flickfyi/identity/dist/signing.js +2 -2
- package/node_modules/@flickfyi/lens/dist/index.js +1 -1
- package/node_modules/@flickfyi/photon/dist/version.cjs +1 -1
- package/node_modules/@flickfyi/photon/dist/version.js +1 -1
- package/node_modules/@flickfyi/photon/generated/react-swiftui.d.ts +1 -1
- package/node_modules/@flickfyi/photon/generated/react-swiftui.json +2 -1
- package/node_modules/@flickfyi/photon/package.json +1 -1
- package/node_modules/@msgpackr-extract/msgpackr-extract-linux-x64/README.md +1 -0
- package/node_modules/@msgpackr-extract/msgpackr-extract-linux-x64/node.abi115.glibc.node +0 -0
- package/node_modules/@msgpackr-extract/msgpackr-extract-linux-x64/node.abi115.musl.node +0 -0
- package/node_modules/@msgpackr-extract/msgpackr-extract-linux-x64/node.napi.glibc.node +0 -0
- package/node_modules/@msgpackr-extract/msgpackr-extract-linux-x64/node.napi.musl.node +0 -0
- package/node_modules/@msgpackr-extract/{msgpackr-extract-darwin-arm64 → msgpackr-extract-linux-x64}/package.json +4 -4
- package/package.json +3 -3
- package/node_modules/@flickfyi/identity/dist/base-ClGB6hXM.js +0 -354
- package/node_modules/@flickfyi/identity/dist/curve-DALK-Fi3.js +0 -2768
- package/node_modules/@flickfyi/identity/dist/cwt-tfd4xMR_.js +0 -3397
- package/node_modules/@flickfyi/identity/dist/nist-luaoKQ1s.js +0 -1194
- package/node_modules/@msgpackr-extract/msgpackr-extract-darwin-arm64/README.md +0 -1
- package/node_modules/@msgpackr-extract/msgpackr-extract-darwin-arm64/node.napi.glibc.node +0 -0
- /package/node_modules/@msgpackr-extract/{msgpackr-extract-darwin-arm64 → msgpackr-extract-linux-x64}/index.js +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Platform specific binary for msgpackr-extract on linux OS with x64 architecture
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "@msgpackr-extract/msgpackr-extract-
|
|
2
|
+
"name": "@msgpackr-extract/msgpackr-extract-linux-x64",
|
|
3
3
|
"version": "3.0.4",
|
|
4
4
|
"os": [
|
|
5
|
-
"
|
|
5
|
+
"linux"
|
|
6
6
|
],
|
|
7
7
|
"cpu": [
|
|
8
|
-
"
|
|
8
|
+
"x64"
|
|
9
9
|
],
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"author": "Kris Zyp",
|
|
@@ -13,5 +13,5 @@
|
|
|
13
13
|
"type": "git",
|
|
14
14
|
"url": "http://github.com/kriszyp/msgpackr-extract"
|
|
15
15
|
},
|
|
16
|
-
"description": "Platform specific binary for msgpackr-extract on
|
|
16
|
+
"description": "Platform specific binary for msgpackr-extract on linux OS with x64 architecture"
|
|
17
17
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flickfyi/flkr",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.118",
|
|
4
4
|
"description": "A tool for managing your Flicks",
|
|
5
5
|
"homepage": "https://flick.fyi/docs/flkr/quick-start",
|
|
6
6
|
"bugs": {
|
|
@@ -41,10 +41,10 @@
|
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@flickfyi/biscuit": "0.0.2",
|
|
44
|
-
"@flickfyi/core": "0.0.
|
|
44
|
+
"@flickfyi/core": "0.0.60",
|
|
45
45
|
"@flickfyi/http-message-sig": "0.0.0",
|
|
46
46
|
"@flickfyi/identity": "0.0.0",
|
|
47
|
-
"@flickfyi/photon": "0.0.
|
|
47
|
+
"@flickfyi/photon": "0.0.29",
|
|
48
48
|
"@inkjs/ui": "2.0.0",
|
|
49
49
|
"@noble/curves": "2.4.0",
|
|
50
50
|
"@noble/hashes": "2.4.0",
|
|
@@ -1,354 +0,0 @@
|
|
|
1
|
-
//#region ../../../../../../.pnpm-store/v11/links/@scure/base/2.4.0/ad23daa89c8f818f846ea08cb1381ee92ffff82c746eeca32889ede9edde648d/node_modules/@scure/base/index.js
|
|
2
|
-
/*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
3
|
-
var freeze = (fn) => Object.freeze(fn());
|
|
4
|
-
function isBytes(a) {
|
|
5
|
-
return a instanceof Uint8Array || ArrayBuffer.isView(a) && a.constructor.name === "Uint8Array" && "BYTES_PER_ELEMENT" in a && a.BYTES_PER_ELEMENT === 1;
|
|
6
|
-
}
|
|
7
|
-
/** Asserts something is Uint8Array. */
|
|
8
|
-
function abytes(b) {
|
|
9
|
-
if (!isBytes(b)) throw new TypeError("Uint8Array expected");
|
|
10
|
-
}
|
|
11
|
-
function astr(label, input) {
|
|
12
|
-
if (typeof input !== "string") throw new TypeError(`${label}: string expected`);
|
|
13
|
-
return true;
|
|
14
|
-
}
|
|
15
|
-
function anumber(n, title = "number") {
|
|
16
|
-
if (typeof n !== "number") throw new TypeError(`${title}: expected number, got ${typeof n}`);
|
|
17
|
-
if (!Number.isSafeInteger(n)) throw new RangeError(`${title}: expected safe integer, got ${n}`);
|
|
18
|
-
}
|
|
19
|
-
function chain(...args) {
|
|
20
|
-
const id = (a) => a;
|
|
21
|
-
const wrap = (a, b) => (c) => a(b(c));
|
|
22
|
-
return {
|
|
23
|
-
encode: args.map((x) => x.encode).reduceRight(wrap, id),
|
|
24
|
-
decode: args.map((x) => x.decode).reduce(wrap, id)
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
var powers = /* @__PURE__ */ (() => {
|
|
28
|
-
let res = [];
|
|
29
|
-
for (let i = 0; i < 40; i++) res.push(2 ** i);
|
|
30
|
-
return res;
|
|
31
|
-
})();
|
|
32
|
-
var asciiDecoder = /* @__PURE__ */ (() => {
|
|
33
|
-
try {
|
|
34
|
-
const decoder = new TextDecoder();
|
|
35
|
-
return decoder.decode(Uint8Array.of(65, 48, 43, 127)) === "A0+" ? decoder : void 0;
|
|
36
|
-
} catch (e) {
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
})();
|
|
40
|
-
var B2S_CHUNK = 8192;
|
|
41
|
-
function charcodesToString(codes) {
|
|
42
|
-
const len = codes.length;
|
|
43
|
-
if (asciiDecoder !== void 0 && len >= 12) return asciiDecoder.decode(codes);
|
|
44
|
-
if (len <= B2S_CHUNK) return String.fromCharCode.apply(null, codes);
|
|
45
|
-
let res = "";
|
|
46
|
-
for (let i = 0; i < len; i += B2S_CHUNK) res += String.fromCharCode.apply(null, codes.subarray(i, i + B2S_CHUNK));
|
|
47
|
-
return res;
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Linear 8 <-> bits regrouping (radix2Slow semantics), with Uint8Array digits and
|
|
51
|
-
* preallocated output.
|
|
52
|
-
*/
|
|
53
|
-
function radix2(bits) {
|
|
54
|
-
anumber(bits);
|
|
55
|
-
if (bits <= 0 || bits > 8) throw new RangeError("radix2: bits should be in (0..8]");
|
|
56
|
-
const mask = powers[bits] - 1;
|
|
57
|
-
return {
|
|
58
|
-
encode: (bytes) => {
|
|
59
|
-
abytes(bytes);
|
|
60
|
-
const len = bytes.length;
|
|
61
|
-
const res = new Uint8Array(Math.ceil(len * 8 / bits));
|
|
62
|
-
let carry = 0;
|
|
63
|
-
let pos = 0;
|
|
64
|
-
let j = 0;
|
|
65
|
-
for (let i = 0; i < len;) {
|
|
66
|
-
if (i + 2 < len) {
|
|
67
|
-
carry = carry << 24 | bytes[i] << 16 | bytes[i + 1] << 8 | bytes[i + 2];
|
|
68
|
-
pos += 24;
|
|
69
|
-
i += 3;
|
|
70
|
-
} else {
|
|
71
|
-
carry = (carry << 8 | bytes[i]) & 65535;
|
|
72
|
-
pos += 8;
|
|
73
|
-
i++;
|
|
74
|
-
}
|
|
75
|
-
for (;;) {
|
|
76
|
-
pos -= bits;
|
|
77
|
-
res[j++] = carry >> pos & mask;
|
|
78
|
-
if (pos < bits) break;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
if (pos > 0) res[j] = carry << bits - pos & mask;
|
|
82
|
-
return res;
|
|
83
|
-
},
|
|
84
|
-
decode: (digits) => {
|
|
85
|
-
const len = digits.length;
|
|
86
|
-
const res = new Uint8Array(Math.floor(len * bits / 8));
|
|
87
|
-
let carry = 0;
|
|
88
|
-
let pos = 0;
|
|
89
|
-
let j = 0;
|
|
90
|
-
for (let i = 0; i < len; i++) {
|
|
91
|
-
carry = (carry << bits | digits[i]) & 65535;
|
|
92
|
-
pos += bits;
|
|
93
|
-
for (; pos >= 8; pos -= 8) res[j++] = carry >> pos - 8 & 255;
|
|
94
|
-
}
|
|
95
|
-
carry = carry << 8 - pos & 255;
|
|
96
|
-
if (pos >= bits) throw new Error("Excess padding");
|
|
97
|
-
if (carry > 0) throw new Error(`Non-zero padding: ${carry}`);
|
|
98
|
-
return res;
|
|
99
|
-
}
|
|
100
|
-
};
|
|
101
|
-
}
|
|
102
|
-
/**
|
|
103
|
-
* Digit <-> letter mapping fused with string join (chain(alphabetSlow(letters), join(''))
|
|
104
|
-
* semantics), via char-code lookup tables.
|
|
105
|
-
*/
|
|
106
|
-
function alphabet(letters, aliases) {
|
|
107
|
-
const len = letters.length;
|
|
108
|
-
if (len > 128) throw new Error("alphabet: max 128 letters");
|
|
109
|
-
const encTable = new Uint8Array(len);
|
|
110
|
-
const decTable = (/* @__PURE__ */ new Int8Array(128)).fill(-1);
|
|
111
|
-
for (let i = 0; i < len; i++) {
|
|
112
|
-
const code = letters.charCodeAt(i);
|
|
113
|
-
if (letters.codePointAt(i) !== code || code > 127) throw new Error("alphabet: single-char ASCII letters only");
|
|
114
|
-
encTable[i] = code;
|
|
115
|
-
decTable[code] = i;
|
|
116
|
-
}
|
|
117
|
-
if (aliases !== void 0) for (const alias of Object.keys(aliases)) {
|
|
118
|
-
const code = alias.charCodeAt(0);
|
|
119
|
-
const target = decTable[aliases[alias].charCodeAt(0)];
|
|
120
|
-
if (alias.length !== 1 || code > 127 || target === void 0 || target === -1) throw new Error(`alphabet: invalid alias ${alias}`);
|
|
121
|
-
decTable[code] = target;
|
|
122
|
-
}
|
|
123
|
-
return {
|
|
124
|
-
encode: (digits) => {
|
|
125
|
-
const codes = new Uint8Array(digits.length);
|
|
126
|
-
for (let i = 0; i < digits.length; i++) {
|
|
127
|
-
const d = digits[i];
|
|
128
|
-
const code = encTable[d];
|
|
129
|
-
if (code === void 0) throw new Error(`alphabet.encode: invalid digit ${d}`);
|
|
130
|
-
codes[i] = code;
|
|
131
|
-
}
|
|
132
|
-
return charcodesToString(codes);
|
|
133
|
-
},
|
|
134
|
-
decode: (input) => {
|
|
135
|
-
astr("decode", input);
|
|
136
|
-
const slen = input.length;
|
|
137
|
-
const digits = new Uint8Array(slen);
|
|
138
|
-
for (let i = 0; i < slen; i++) {
|
|
139
|
-
const code = input.charCodeAt(i);
|
|
140
|
-
const digit = code < 128 ? decTable[code] : -1;
|
|
141
|
-
if (digit === -1) throw new Error(`Unknown letter "${input[i]}". Allowed: ${letters}`);
|
|
142
|
-
digits[i] = digit;
|
|
143
|
-
}
|
|
144
|
-
return digits;
|
|
145
|
-
}
|
|
146
|
-
};
|
|
147
|
-
}
|
|
148
|
-
/**
|
|
149
|
-
* Pad / unpad (paddingSlow semantics), on the joined string.
|
|
150
|
-
*/
|
|
151
|
-
function padding(bits, chr = "=") {
|
|
152
|
-
anumber(bits);
|
|
153
|
-
astr("padding", chr);
|
|
154
|
-
return {
|
|
155
|
-
encode(data) {
|
|
156
|
-
while (data.length * bits % 8) data += chr;
|
|
157
|
-
return data;
|
|
158
|
-
},
|
|
159
|
-
decode(input) {
|
|
160
|
-
astr("decode", input);
|
|
161
|
-
let end = input.length;
|
|
162
|
-
if (end * bits % 8) throw new Error("padding: invalid length");
|
|
163
|
-
for (; end > 0 && input[end - 1] === chr; end--) if ((end - 1) * bits % 8 === 0) throw new Error("padding: excess padding");
|
|
164
|
-
return input.slice(0, end);
|
|
165
|
-
}
|
|
166
|
-
};
|
|
167
|
-
}
|
|
168
|
-
var hasBase64Builtin = /* @__PURE__ */ (() => typeof Uint8Array.from([]).toBase64 === "function" && typeof Uint8Array.fromBase64 === "function")();
|
|
169
|
-
var ASCII_WHITESPACE = /[\t\n\f\r ]/;
|
|
170
|
-
var decodeBase64Builtin = (s, isUrl) => {
|
|
171
|
-
astr("base64", s);
|
|
172
|
-
const alphabet = isUrl ? "base64url" : "base64";
|
|
173
|
-
if (s.length > 0 && ASCII_WHITESPACE.test(s)) throw new Error("invalid base64");
|
|
174
|
-
return Uint8Array.fromBase64(s, {
|
|
175
|
-
alphabet,
|
|
176
|
-
lastChunkHandling: "strict"
|
|
177
|
-
});
|
|
178
|
-
};
|
|
179
|
-
/** base64 from RFC 4648. Padded. Pure JS version */
|
|
180
|
-
var base64Fallback = /* @__PURE__ */ freeze(() => chain(radix2(6), alphabet("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"), padding(6)));
|
|
181
|
-
/** base64url from RFC 4648. Padded. Pure JS version */
|
|
182
|
-
var base64urlFallback = /* @__PURE__ */ freeze(() => chain(radix2(6), alphabet("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"), padding(6)));
|
|
183
|
-
/**
|
|
184
|
-
* base64 from RFC 4648. Padded.
|
|
185
|
-
* Alternative variants: `base64nopad`, `base64url`, `base64urlnopad`.
|
|
186
|
-
* Utilizes native `Uint8Array.fromBase64` builtin, otherwise falls back to `base64fallback` when it's unavailable.
|
|
187
|
-
* @example
|
|
188
|
-
* ```js
|
|
189
|
-
* base64.encode(Uint8Array.from([0x12, 0xab]));
|
|
190
|
-
* // => 'Eqs='
|
|
191
|
-
* base64.decode('Eqs=');
|
|
192
|
-
* // => Uint8Array.from([0x12, 0xab])
|
|
193
|
-
* ```
|
|
194
|
-
*/
|
|
195
|
-
var base64 = /* @__PURE__ */ freeze(() => hasBase64Builtin ? {
|
|
196
|
-
encode(b) {
|
|
197
|
-
abytes(b);
|
|
198
|
-
return b.toBase64();
|
|
199
|
-
},
|
|
200
|
-
decode(s) {
|
|
201
|
-
return decodeBase64Builtin(s, false);
|
|
202
|
-
}
|
|
203
|
-
} : base64Fallback);
|
|
204
|
-
/**
|
|
205
|
-
* base64 from RFC 4648, using URL-safe alphabet. Padded.
|
|
206
|
-
* Use `base64urlnopad` for unpadded version.
|
|
207
|
-
* Falls back to built-in function, when available.
|
|
208
|
-
* @example
|
|
209
|
-
* ```js
|
|
210
|
-
* base64url.encode(Uint8Array.from([0x12, 0xab]));
|
|
211
|
-
* // => 'Eqs='
|
|
212
|
-
* base64url.decode('Eqs=');
|
|
213
|
-
* // => Uint8Array.from([0x12, 0xab])
|
|
214
|
-
* ```
|
|
215
|
-
*/
|
|
216
|
-
var base64url = /* @__PURE__ */ freeze(() => hasBase64Builtin ? {
|
|
217
|
-
encode(b) {
|
|
218
|
-
abytes(b);
|
|
219
|
-
return b.toBase64({ alphabet: "base64url" });
|
|
220
|
-
},
|
|
221
|
-
decode(s) {
|
|
222
|
-
return decodeBase64Builtin(s, true);
|
|
223
|
-
}
|
|
224
|
-
} : base64urlFallback);
|
|
225
|
-
/**
|
|
226
|
-
* base64 from RFC 4648, using URL-safe alphabet. No padding.
|
|
227
|
-
* Use `base64url` for padded version.
|
|
228
|
-
* @example
|
|
229
|
-
* ```js
|
|
230
|
-
* base64urlnopad.encode(Uint8Array.from([0x12, 0xab]));
|
|
231
|
-
* // => 'Eqs'
|
|
232
|
-
* base64urlnopad.decode('Eqs');
|
|
233
|
-
* // => Uint8Array.from([0x12, 0xab])
|
|
234
|
-
* ```
|
|
235
|
-
*/
|
|
236
|
-
var base64urlnopad = /* @__PURE__ */ freeze(() => chain(radix2(6), alphabet("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_")));
|
|
237
|
-
var B58_GROUP = 656356768;
|
|
238
|
-
var RADIX_BASE_N_MAX_LENGTH = 65536;
|
|
239
|
-
var BASE_N_MAX_BYTES = 2048;
|
|
240
|
-
var BASE_N_MAX_CHARS = 4096;
|
|
241
|
-
var radixBaseN = (BASE, GROUP) => ({
|
|
242
|
-
encode: (bytes) => {
|
|
243
|
-
abytes(bytes);
|
|
244
|
-
const blen = bytes.length;
|
|
245
|
-
if (blen === 0) return /* @__PURE__ */ new Uint8Array(0);
|
|
246
|
-
if (blen >= RADIX_BASE_N_MAX_LENGTH) throw new Error("invalid length");
|
|
247
|
-
let zeros = 0;
|
|
248
|
-
while (zeros < blen - 1 && bytes[zeros] === 0) zeros++;
|
|
249
|
-
const nlimbs = Math.ceil(blen / 2);
|
|
250
|
-
const limbs = new Uint16Array(nlimbs);
|
|
251
|
-
const odd = blen & 1;
|
|
252
|
-
if (odd) limbs[0] = bytes[0];
|
|
253
|
-
for (let i = odd, j = odd; i < blen; i += 2, j++) limbs[j] = bytes[i] << 8 | bytes[i + 1];
|
|
254
|
-
const groups = [];
|
|
255
|
-
let pos = 0;
|
|
256
|
-
while (pos < nlimbs) {
|
|
257
|
-
let carry = 0;
|
|
258
|
-
for (let i = pos; i < nlimbs; i++) {
|
|
259
|
-
const cur = carry * 65536 + limbs[i];
|
|
260
|
-
const q = Math.floor(cur / GROUP);
|
|
261
|
-
carry = cur - q * GROUP;
|
|
262
|
-
limbs[i] = q;
|
|
263
|
-
if (q === 0 && i === pos) pos++;
|
|
264
|
-
}
|
|
265
|
-
groups.push(carry);
|
|
266
|
-
}
|
|
267
|
-
const top = groups.length - 1;
|
|
268
|
-
let sig = top * 5;
|
|
269
|
-
for (let v = groups[top];; v = Math.floor(v / BASE)) {
|
|
270
|
-
sig++;
|
|
271
|
-
if (v < BASE) break;
|
|
272
|
-
}
|
|
273
|
-
const res = new Uint8Array(zeros + sig);
|
|
274
|
-
let j = res.length - 1;
|
|
275
|
-
for (let g = 0; g < top; g++) {
|
|
276
|
-
let v = groups[g];
|
|
277
|
-
for (let k = 0; k < 5; k++) {
|
|
278
|
-
res[j--] = v % BASE;
|
|
279
|
-
v = Math.floor(v / BASE);
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
for (let v = groups[top]; j >= zeros; v = Math.floor(v / BASE)) res[j--] = v % BASE;
|
|
283
|
-
return res;
|
|
284
|
-
},
|
|
285
|
-
decode: (digits) => {
|
|
286
|
-
abytes(digits);
|
|
287
|
-
const dlen = digits.length;
|
|
288
|
-
if (dlen === 0) return /* @__PURE__ */ new Uint8Array(0);
|
|
289
|
-
if (dlen >= RADIX_BASE_N_MAX_LENGTH) throw new Error("invalid length");
|
|
290
|
-
let zeros = 0;
|
|
291
|
-
while (zeros < dlen - 1 && digits[zeros] === 0) zeros++;
|
|
292
|
-
const limbs = new Uint16Array(Math.ceil(dlen * 6 / 16) + 1);
|
|
293
|
-
let used = 0;
|
|
294
|
-
let i = 0;
|
|
295
|
-
let group = dlen % 5 || 5;
|
|
296
|
-
while (i < dlen) {
|
|
297
|
-
let gval = 0;
|
|
298
|
-
let factor = 1;
|
|
299
|
-
for (const end = i + group; i < end; i++) {
|
|
300
|
-
const d = digits[i];
|
|
301
|
-
if (d >= BASE) throw new Error(`invalid integer: ${d}`);
|
|
302
|
-
gval = gval * BASE + d;
|
|
303
|
-
factor *= BASE;
|
|
304
|
-
}
|
|
305
|
-
group = 5;
|
|
306
|
-
let carry = gval;
|
|
307
|
-
for (let k = 0; k < used; k++) {
|
|
308
|
-
const cur = limbs[k] * factor + carry;
|
|
309
|
-
carry = Math.floor(cur / 65536);
|
|
310
|
-
limbs[k] = cur - carry * 65536;
|
|
311
|
-
}
|
|
312
|
-
for (; carry > 0; carry = Math.floor(carry / 65536)) limbs[used++] = carry % 65536;
|
|
313
|
-
}
|
|
314
|
-
const valueBytes = used === 0 ? 1 : used * 2 - (limbs[used - 1] < 256 ? 1 : 0);
|
|
315
|
-
const res = new Uint8Array(zeros + valueBytes);
|
|
316
|
-
let j = res.length - 1;
|
|
317
|
-
for (let k = 0; k < used; k++) {
|
|
318
|
-
const limb = limbs[k];
|
|
319
|
-
res[j--] = limb & 255;
|
|
320
|
-
if (j >= zeros) res[j--] = limb >> 8;
|
|
321
|
-
}
|
|
322
|
-
return res;
|
|
323
|
-
}
|
|
324
|
-
});
|
|
325
|
-
var genBaseN = (radix, abc) => {
|
|
326
|
-
const letters = alphabet(abc);
|
|
327
|
-
return {
|
|
328
|
-
encode(bytes) {
|
|
329
|
-
abytes(bytes);
|
|
330
|
-
if (bytes.length > BASE_N_MAX_BYTES) throw new Error("invalid length");
|
|
331
|
-
return letters.encode(radix.encode(bytes));
|
|
332
|
-
},
|
|
333
|
-
decode(str) {
|
|
334
|
-
astr("baseN.decode", str);
|
|
335
|
-
if (str.length > BASE_N_MAX_CHARS) throw new Error("invalid length");
|
|
336
|
-
return radix.decode(letters.decode(str));
|
|
337
|
-
}
|
|
338
|
-
};
|
|
339
|
-
};
|
|
340
|
-
var radix58 = /* @__PURE__ */ radixBaseN(58, B58_GROUP);
|
|
341
|
-
var genBase58 = (abc) => genBaseN(radix58, abc);
|
|
342
|
-
/**
|
|
343
|
-
* base58: base64 without ambigous characters +, /, 0, O, I, l.
|
|
344
|
-
* Quadratic (O(n^2)) - so, can't be used on large inputs.
|
|
345
|
-
* @example
|
|
346
|
-
* ```js
|
|
347
|
-
* const text = base58.encode(Uint8Array.from([0, 1, 2]));
|
|
348
|
-
* base58.decode(text);
|
|
349
|
-
* // => Uint8Array.from([0, 1, 2])
|
|
350
|
-
* ```
|
|
351
|
-
*/
|
|
352
|
-
var base58 = /* @__PURE__ */ freeze(() => genBase58("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"));
|
|
353
|
-
//#endregion
|
|
354
|
-
export { base64urlnopad as i, base64 as n, base64url as r, base58 as t };
|