@bitspark/archon-sdk 0.11.0 → 0.12.0
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/src/index.d.ts
CHANGED
package/dist/src/index.js
CHANGED
|
@@ -21,6 +21,7 @@ export * from "./possession.js";
|
|
|
21
21
|
export * from "./envelope.js";
|
|
22
22
|
export * from "./login.js";
|
|
23
23
|
export * from "./login-audience.js";
|
|
24
|
+
export * from "./login-display.js";
|
|
24
25
|
export * from "./enroll.js";
|
|
25
26
|
export * from "./request.js";
|
|
26
27
|
//# sourceMappingURL=index.js.map
|
package/dist/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,mDAAmD;AACnD,EAAE;AACF,uFAAuF;AACvF,wEAAwE;AACxE,EAAE;AACF,qFAAqF;AACrF,kEAAkE;AAClE,gFAAgF;AAChF,EAAE;AACF,6FAA6F;AAC7F,8FAA8F;AAC9F,wBAAwB;AACxB,EAAE;AACF,+EAA+E;AAC/E,yFAAyF;AACzF,sFAAsF;AACtF,uFAAuF;AACvF,+CAA+C;AAC/C,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,qBAAqB,CAAC;AACpC,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,mDAAmD;AACnD,EAAE;AACF,uFAAuF;AACvF,wEAAwE;AACxE,EAAE;AACF,qFAAqF;AACrF,kEAAkE;AAClE,gFAAgF;AAChF,EAAE;AACF,6FAA6F;AAC7F,8FAA8F;AAC9F,wBAAwB;AACxB,EAAE;AACF,+EAA+E;AAC/E,yFAAyF;AACzF,sFAAsF;AACtF,uFAAuF;AACvF,+CAA+C;AAC/C,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether `codePoint` is one archon will not show as itself: a terminal may render it as
|
|
3
|
+
* nothing, or let it rearrange or hide the text around it, so that what a person reads differs
|
|
4
|
+
* from the bytes they sign. The set is `Cc ∪ Cf ∪ Zl ∪ Zp ∪ Default_Ignorable_Code_Point`:
|
|
5
|
+
* control characters (C0, DEL, C1), format characters (bidirectional controls, zero-width
|
|
6
|
+
* characters, invisible operators, interlinear annotations, tags), the line and paragraph
|
|
7
|
+
* separators, and every code point Unicode says should render invisibly (soft hyphen, combining
|
|
8
|
+
* grapheme joiner, Hangul fillers, variation selectors, …).
|
|
9
|
+
*
|
|
10
|
+
* It takes a CODE POINT, not a UTF-16 unit: iterate a string with `for (const ch of s)` and pass
|
|
11
|
+
* `ch.codePointAt(0)`, or the astral tag block is never seen. The list is frozen as explicit
|
|
12
|
+
* ranges, identical in the three lanes and pinned by vectors/display-unsafe.json. It is stricter
|
|
13
|
+
* than the binding's own grammar, which refuses only C0 and DEL: the wire is unchanged, and this
|
|
14
|
+
* is the rule for what may be SHOWN. A look-alike character (a Cyrillic "а" for a Latin "a") is
|
|
15
|
+
* not in it; no list of code points can catch those.
|
|
16
|
+
*/
|
|
17
|
+
export declare function displayUnsafe(codePoint: number): boolean;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// What may be shown: the code points archon will not show as themselves (docs/login.md §5).
|
|
2
|
+
/** vectors/display-unsafe.json's list, sorted and disjoint, as [first, last] code points. */
|
|
3
|
+
const DISPLAY_UNSAFE_RANGES = [
|
|
4
|
+
[0x0000, 0x001f], [0x007f, 0x009f], [0x00ad, 0x00ad], [0x034f, 0x034f],
|
|
5
|
+
[0x0600, 0x0605], [0x061c, 0x061c], [0x06dd, 0x06dd], [0x070f, 0x070f],
|
|
6
|
+
[0x0890, 0x0891], [0x08e2, 0x08e2], [0x115f, 0x1160], [0x17b4, 0x17b5],
|
|
7
|
+
[0x180b, 0x180f], [0x200b, 0x200f], [0x2028, 0x202e], [0x2060, 0x206f],
|
|
8
|
+
[0x3164, 0x3164], [0xfe00, 0xfe0f], [0xfeff, 0xfeff], [0xffa0, 0xffa0],
|
|
9
|
+
[0xfff0, 0xfffb], [0x110bd, 0x110bd], [0x110cd, 0x110cd], [0x13430, 0x1343f],
|
|
10
|
+
[0x1bca0, 0x1bca3], [0x1d173, 0x1d17a], [0xe0000, 0xe0fff],
|
|
11
|
+
];
|
|
12
|
+
/**
|
|
13
|
+
* Whether `codePoint` is one archon will not show as itself: a terminal may render it as
|
|
14
|
+
* nothing, or let it rearrange or hide the text around it, so that what a person reads differs
|
|
15
|
+
* from the bytes they sign. The set is `Cc ∪ Cf ∪ Zl ∪ Zp ∪ Default_Ignorable_Code_Point`:
|
|
16
|
+
* control characters (C0, DEL, C1), format characters (bidirectional controls, zero-width
|
|
17
|
+
* characters, invisible operators, interlinear annotations, tags), the line and paragraph
|
|
18
|
+
* separators, and every code point Unicode says should render invisibly (soft hyphen, combining
|
|
19
|
+
* grapheme joiner, Hangul fillers, variation selectors, …).
|
|
20
|
+
*
|
|
21
|
+
* It takes a CODE POINT, not a UTF-16 unit: iterate a string with `for (const ch of s)` and pass
|
|
22
|
+
* `ch.codePointAt(0)`, or the astral tag block is never seen. The list is frozen as explicit
|
|
23
|
+
* ranges, identical in the three lanes and pinned by vectors/display-unsafe.json. It is stricter
|
|
24
|
+
* than the binding's own grammar, which refuses only C0 and DEL: the wire is unchanged, and this
|
|
25
|
+
* is the rule for what may be SHOWN. A look-alike character (a Cyrillic "а" for a Latin "a") is
|
|
26
|
+
* not in it; no list of code points can catch those.
|
|
27
|
+
*/
|
|
28
|
+
export function displayUnsafe(codePoint) {
|
|
29
|
+
let lo = 0;
|
|
30
|
+
let hi = DISPLAY_UNSAFE_RANGES.length;
|
|
31
|
+
while (lo < hi) {
|
|
32
|
+
const mid = (lo + hi) >> 1;
|
|
33
|
+
if (DISPLAY_UNSAFE_RANGES[mid][1] < codePoint)
|
|
34
|
+
lo = mid + 1;
|
|
35
|
+
else
|
|
36
|
+
hi = mid;
|
|
37
|
+
}
|
|
38
|
+
return lo < DISPLAY_UNSAFE_RANGES.length && DISPLAY_UNSAFE_RANGES[lo][0] <= codePoint;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=login-display.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"login-display.js","sourceRoot":"","sources":["../../src/login-display.ts"],"names":[],"mappings":"AAAA,4FAA4F;AAE5F,6FAA6F;AAC7F,MAAM,qBAAqB,GAA6C;IACtE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;IACtE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;IACtE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;IACtE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;IACtE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;IACtE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC;IAC5E,CAAC,OAAO,EAAE,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC;CAC3D,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,aAAa,CAAC,SAAiB;IAC7C,IAAI,EAAE,GAAG,CAAC,CAAC;IACX,IAAI,EAAE,GAAG,qBAAqB,CAAC,MAAM,CAAC;IACtC,OAAO,EAAE,GAAG,EAAE,EAAE,CAAC;QACf,MAAM,GAAG,GAAG,CAAC,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;QAC3B,IAAI,qBAAqB,CAAC,GAAG,CAAE,CAAC,CAAC,CAAC,GAAG,SAAS;YAAE,EAAE,GAAG,GAAG,GAAG,CAAC,CAAC;;YACxD,EAAE,GAAG,GAAG,CAAC;IAChB,CAAC;IACD,OAAO,EAAE,GAAG,qBAAqB,CAAC,MAAM,IAAI,qBAAqB,CAAC,EAAE,CAAE,CAAC,CAAC,CAAC,IAAI,SAAS,CAAC;AACzF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bitspark/archon-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0",
|
|
4
4
|
"description": "archon-sdk: proof of possession and the signed envelope, one layer above the identity floor. Deterministic given its inputs; no RNG, no clock, no socket.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"test": "tsc -p tsconfig.json && node --test dist/test/*.test.js"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@bitspark/archon": "^0.
|
|
25
|
+
"@bitspark/archon": "^0.12.0",
|
|
26
26
|
"@noble/hashes": "^2.2.0"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|