@ac-kit/net-address 0.4.1 → 0.6.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/CHANGELOG.md +114 -0
- package/README.md +88 -3
- package/dist/eui/eui-bits.d.ts.map +1 -1
- package/dist/eui/eui-bits.js +7 -6
- package/dist/eui/eui-bits.js.map +1 -1
- package/dist/eui/print-eui.d.ts.map +1 -1
- package/dist/eui/print-eui.js +4 -4
- package/dist/eui/print-eui.js.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/ip/_ip-width.d.ts +3 -0
- package/dist/ip/_ip-width.d.ts.map +1 -0
- package/dist/ip/_ip-width.js +9 -0
- package/dist/ip/_ip-width.js.map +1 -0
- package/dist/ip/classify-ip.d.ts +54 -0
- package/dist/ip/classify-ip.d.ts.map +1 -0
- package/dist/ip/classify-ip.js +64 -0
- package/dist/ip/classify-ip.js.map +1 -0
- package/dist/ip/global-address-check.d.ts +56 -0
- package/dist/ip/global-address-check.d.ts.map +1 -0
- package/dist/ip/global-address-check.js +60 -0
- package/dist/ip/global-address-check.js.map +1 -0
- package/dist/ip/ip-address.d.ts +10 -0
- package/dist/ip/ip-address.d.ts.map +1 -1
- package/dist/ip/ip-address.js +21 -9
- package/dist/ip/ip-address.js.map +1 -1
- package/dist/ip/ip-prefix.d.ts +37 -0
- package/dist/ip/ip-prefix.d.ts.map +1 -0
- package/dist/ip/ip-prefix.js +70 -0
- package/dist/ip/ip-prefix.js.map +1 -0
- package/dist/ip/url-host.d.ts +31 -0
- package/dist/ip/url-host.d.ts.map +1 -0
- package/dist/ip/url-host.js +43 -0
- package/dist/ip/url-host.js.map +1 -0
- package/dist/ipv4/classify-ipv4.d.ts +16 -4
- package/dist/ipv4/classify-ipv4.d.ts.map +1 -1
- package/dist/ipv4/classify-ipv4.js +33 -18
- package/dist/ipv4/classify-ipv4.js.map +1 -1
- package/dist/ipv4/parse-ipv4.d.ts +4 -1
- package/dist/ipv4/parse-ipv4.d.ts.map +1 -1
- package/dist/ipv4/parse-ipv4.js +41 -13
- package/dist/ipv4/parse-ipv4.js.map +1 -1
- package/dist/ipv6/_embedded-ipv4.d.ts +8 -0
- package/dist/ipv6/_embedded-ipv4.d.ts.map +1 -0
- package/dist/ipv6/_embedded-ipv4.js +11 -0
- package/dist/ipv6/_embedded-ipv4.js.map +1 -0
- package/dist/ipv6/classify-ipv6.d.ts +51 -9
- package/dist/ipv6/classify-ipv6.d.ts.map +1 -1
- package/dist/ipv6/classify-ipv6.js +82 -13
- package/dist/ipv6/classify-ipv6.js.map +1 -1
- package/dist/ipv6/ipv4-mapped.d.ts.map +1 -1
- package/dist/ipv6/ipv4-mapped.js +6 -4
- package/dist/ipv6/ipv4-mapped.js.map +1 -1
- package/dist/ipv6/parse-ipv6.d.ts +6 -4
- package/dist/ipv6/parse-ipv6.d.ts.map +1 -1
- package/dist/ipv6/parse-ipv6.js +14 -7
- package/dist/ipv6/parse-ipv6.js.map +1 -1
- package/dist/ipv6/print-ipv6.d.ts +43 -10
- package/dist/ipv6/print-ipv6.d.ts.map +1 -1
- package/dist/ipv6/print-ipv6.js +64 -18
- package/dist/ipv6/print-ipv6.js.map +1 -1
- package/dist/prefix/_frozen.d.ts +6 -0
- package/dist/prefix/_frozen.d.ts.map +1 -0
- package/dist/prefix/_frozen.js +17 -0
- package/dist/prefix/_frozen.js.map +1 -0
- package/package.json +5 -4
package/dist/ipv6/print-ipv6.js
CHANGED
|
@@ -28,18 +28,9 @@ function longestZeroRun(groups) {
|
|
|
28
28
|
}
|
|
29
29
|
return best;
|
|
30
30
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
* never for a single group. An IPv4-mapped address is printed `::ffff:a.b.c.d`,
|
|
35
|
-
* per §5.
|
|
36
|
-
*
|
|
37
|
-
* O(1): the address has a fixed eight groups.
|
|
38
|
-
*
|
|
39
|
-
* @throws RangeError When the address is not 128 bits wide.
|
|
40
|
-
*/
|
|
41
|
-
export function printIpv6Address(address) {
|
|
42
|
-
assertBitAddressWidth(address, IPV6_BIT_WIDTH);
|
|
31
|
+
// The whole address in hexadecimal: four digits per 16-bit group.
|
|
32
|
+
const IPV6_HEX_DIGIT_COUNT = IPV6_BIT_WIDTH / 4;
|
|
33
|
+
function printRfc5952(address) {
|
|
43
34
|
if (isIpv6Ipv4Mapped(address)) {
|
|
44
35
|
// Non-null: a mapped address always embeds an IPv4 address.
|
|
45
36
|
return `::ffff:${printIpv4Address(ipv4FromIpv6(address))}`;
|
|
@@ -54,25 +45,80 @@ export function printIpv6Address(address) {
|
|
|
54
45
|
.slice(run.start + run.length)
|
|
55
46
|
.join(":")}`;
|
|
56
47
|
}
|
|
48
|
+
/** Eight colon-separated groups, each four digits or, unpadded, its value. */
|
|
49
|
+
function printAllGroups(address, isPadded) {
|
|
50
|
+
// One bigint conversion for the whole address, then string slicing only.
|
|
51
|
+
const digits = address.value.toString(16).padStart(IPV6_HEX_DIGIT_COUNT, "0");
|
|
52
|
+
let text = "";
|
|
53
|
+
for (let start = 0; start < IPV6_HEX_DIGIT_COUNT; start += 4) {
|
|
54
|
+
const group = digits.slice(start, start + 4);
|
|
55
|
+
text += `${start === 0 ? "" : ":"}${isPadded ? group : Number.parseInt(group, 16).toString(16)}`;
|
|
56
|
+
}
|
|
57
|
+
return text;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Prints the address in one of the RFC 4291 §2.2 spellings, all lowercase.
|
|
61
|
+
*
|
|
62
|
+
* - `"canonical"`, the default, is the RFC 5952 form: no leading zeros in a
|
|
63
|
+
* group, the longest run of zero groups compressed to `::` — leftmost on a
|
|
64
|
+
* tie, and never for a single group — and an IPv4-mapped address printed
|
|
65
|
+
* `::ffff:a.b.c.d`, per §5. Reach for it whenever the text is compared,
|
|
66
|
+
* stored, logged or shown.
|
|
67
|
+
* - `"uncompressed"` writes all eight groups, no `::` and no leading zeros:
|
|
68
|
+
* `2001:db8:0:0:0:0:0:1`.
|
|
69
|
+
* - `"expanded"` writes all eight groups as four digits each, 39 characters
|
|
70
|
+
* always: `2001:0db8:0000:0000:0000:0000:0000:0001`. It sorts as the address
|
|
71
|
+
* does, and is what fixed-width columns and `sipcalc`'s "Expanded Address"
|
|
72
|
+
* use.
|
|
73
|
+
*
|
|
74
|
+
* The last two never use a dotted quad, an IPv4-mapped address included. Every
|
|
75
|
+
* form parses back to the same address with `parseIpv6Address`.
|
|
76
|
+
*
|
|
77
|
+
* O(1): the address has a fixed eight groups.
|
|
78
|
+
*
|
|
79
|
+
* @example
|
|
80
|
+
* const address = parseIpv6Address("2001:db8::1");
|
|
81
|
+
* printIpv6Address(address); // "2001:db8::1"
|
|
82
|
+
* printIpv6Address(address, { form: "uncompressed" }); // "2001:db8:0:0:0:0:0:1"
|
|
83
|
+
*
|
|
84
|
+
* @throws RangeError When the address is not 128 bits wide, or `form` is none
|
|
85
|
+
* of the above.
|
|
86
|
+
*/
|
|
87
|
+
export function printIpv6Address(address, options) {
|
|
88
|
+
assertBitAddressWidth(address, IPV6_BIT_WIDTH);
|
|
89
|
+
const form = options?.form ?? "canonical";
|
|
90
|
+
switch (form) {
|
|
91
|
+
case "canonical":
|
|
92
|
+
return printRfc5952(address);
|
|
93
|
+
case "uncompressed":
|
|
94
|
+
return printAllGroups(address, false);
|
|
95
|
+
case "expanded":
|
|
96
|
+
return printAllGroups(address, true);
|
|
97
|
+
default:
|
|
98
|
+
throw new RangeError(`Unknown IPv6 print form ${String(form)}`);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
57
101
|
/**
|
|
58
|
-
* Prints the canonical form
|
|
102
|
+
* Prints the address, in the canonical form unless `options` picks another,
|
|
103
|
+
* followed by `%zone` when it carries one.
|
|
59
104
|
*
|
|
60
105
|
* The zone is emitted verbatim, not percent-encoded: RFC 6874's `%25` belongs
|
|
61
106
|
* to whatever URI the caller is building.
|
|
62
107
|
*
|
|
63
108
|
* @throws RangeError When the address is not 128 bits wide.
|
|
64
109
|
*/
|
|
65
|
-
export function printIpv6ScopedAddress(scoped) {
|
|
66
|
-
const text = printIpv6Address(scoped.address);
|
|
110
|
+
export function printIpv6ScopedAddress(scoped, options) {
|
|
111
|
+
const text = printIpv6Address(scoped.address, options);
|
|
67
112
|
return scoped.zoneId === null ? text : `${text}%${scoped.zoneId}`;
|
|
68
113
|
}
|
|
69
114
|
/**
|
|
70
|
-
* Prints CIDR notation, keeping any host bits the prefix carries
|
|
115
|
+
* Prints CIDR notation, keeping any host bits the prefix carries; the address
|
|
116
|
+
* in the canonical form unless `options` picks another.
|
|
71
117
|
*
|
|
72
118
|
* @throws RangeError When the prefix is not over a 128-bit address.
|
|
73
119
|
*/
|
|
74
|
-
export function printIpv6Prefix(prefix) {
|
|
75
|
-
return `${printIpv6Address(prefix.address)}/${prefix.prefixLength}`;
|
|
120
|
+
export function printIpv6Prefix(prefix, options) {
|
|
121
|
+
return `${printIpv6Address(prefix.address, options)}/${prefix.prefixLength}`;
|
|
76
122
|
}
|
|
77
123
|
/**
|
|
78
124
|
* The `ip6.arpa` name for the address, as RFC 3596 §2.5 defines it: the 32
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"print-ipv6.js","sourceRoot":"","sources":["../../src/ipv6/print-ipv6.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAEN,qBAAqB,GACrB,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAGlE;;;GAGG;AACH,SAAS,cAAc,CACtB,MAAyB;IAEzB,IAAI,IAAI,GAA6C,IAAI,CAAC;IAC1D,IAAI,QAAQ,GAAG,CAAC,CAAC,CAAC;IAElB,KAAK,IAAI,KAA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c,GAAG,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC;QACzD,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC;QAC/C,IAAI,KAAK,EAAE,CAAC;IACb,CAAC;IAED,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC;AACxC,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { BitAddress } from "./bit-address.js";
|
|
2
|
+
import type { BitPrefix } from "./bit-prefix.js";
|
|
3
|
+
export declare function freezeBitAddress(address: BitAddress): BitAddress;
|
|
4
|
+
export declare function freezeBitPrefix(prefix: BitPrefix): BitPrefix;
|
|
5
|
+
export declare function freezeBitPrefixes(prefixes: BitPrefix[]): readonly BitPrefix[];
|
|
6
|
+
//# sourceMappingURL=_frozen.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_frozen.d.ts","sourceRoot":"","sources":["../../src/prefix/_frozen.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAMjD,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,UAAU,GAAG,UAAU,CAEhE;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,SAAS,GAAG,SAAS,CAI5D;AAED,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,SAAS,EAAE,GAAG,SAAS,SAAS,EAAE,CAM7E"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// An exported constant is the same object the classifiers read, so a caller
|
|
2
|
+
// assigning to one would change every later classification in the process.
|
|
3
|
+
// Frozen, the assignment throws in strict code and is ignored elsewhere.
|
|
4
|
+
export function freezeBitAddress(address) {
|
|
5
|
+
return Object.freeze(address);
|
|
6
|
+
}
|
|
7
|
+
export function freezeBitPrefix(prefix) {
|
|
8
|
+
freezeBitAddress(prefix.address);
|
|
9
|
+
return Object.freeze(prefix);
|
|
10
|
+
}
|
|
11
|
+
export function freezeBitPrefixes(prefixes) {
|
|
12
|
+
for (const prefix of prefixes) {
|
|
13
|
+
freezeBitPrefix(prefix);
|
|
14
|
+
}
|
|
15
|
+
return Object.freeze(prefixes);
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=_frozen.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_frozen.js","sourceRoot":"","sources":["../../src/prefix/_frozen.ts"],"names":[],"mappings":"AAGA,4EAA4E;AAC5E,2EAA2E;AAC3E,yEAAyE;AAEzE,MAAM,UAAU,gBAAgB,CAAC,OAAmB;IACnD,OAAO,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;AAC/B,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,MAAiB;IAChD,gBAAgB,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAEjC,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AAC9B,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,QAAqB;IACtD,KAAK,MAAM,MAAM,IAAI,QAAQ,EAAE,CAAC;QAC/B,eAAe,CAAC,MAAM,CAAC,CAAC;IACzB,CAAC;IAED,OAAO,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;AAChC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ac-kit/net-address",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "Network addresses: IPv4, IPv6, EUI-48/EUI-64 and ports, over one fixed-width prefix core.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cidr",
|
|
@@ -46,12 +46,13 @@
|
|
|
46
46
|
"prepack": "yarn build"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@ac-kit/algo": "^0.
|
|
50
|
-
"@ac-kit/core": "^0.
|
|
51
|
-
"@ac-kit/math-numbers": "^0.2.
|
|
49
|
+
"@ac-kit/algo": "^0.4.1",
|
|
50
|
+
"@ac-kit/core": "^0.11.0",
|
|
51
|
+
"@ac-kit/math-numbers": "^0.2.8",
|
|
52
52
|
"@types/web": "^0.0.367"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
|
+
"@ac-kit/math-random": "0.3.0",
|
|
55
56
|
"@ac-kit/tsconfig": "0.1.0",
|
|
56
57
|
"@ac-kit/typedoc-config": "0.1.0",
|
|
57
58
|
"@ac-kit/vitest-config": "0.1.1",
|