@thi.ng/binary 3.4.18 → 3.4.19
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 +1 -1
- package/mask.d.ts +6 -3
- package/package.json +7 -7
- package/swizzle.d.ts +28 -11
package/CHANGELOG.md
CHANGED
package/mask.d.ts
CHANGED
|
@@ -4,11 +4,14 @@ import type { FnU2 } from "@thi.ng/api";
|
|
|
4
4
|
* 0-32. `b` MUST be >= `a`.
|
|
5
5
|
*
|
|
6
6
|
* @example
|
|
7
|
-
* ```ts
|
|
7
|
+
* ```ts tangle:../export/mask.ts
|
|
8
8
|
* import { defMask } from "@thi.ng/binary";
|
|
9
9
|
*
|
|
10
|
-
* defMask(1,31).toString(16)
|
|
11
|
-
*
|
|
10
|
+
* console.log(defMask(1,31).toString(16));
|
|
11
|
+
* // 7ffffffe
|
|
12
|
+
*
|
|
13
|
+
* console.log(defMask(3,8).toString(16));
|
|
14
|
+
* // f8
|
|
12
15
|
* ```
|
|
13
16
|
*
|
|
14
17
|
* @param a - first bit
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/binary",
|
|
3
|
-
"version": "3.4.
|
|
3
|
+
"version": "3.4.19",
|
|
4
4
|
"description": "100+ assorted binary / bitwise operations, conversions, utilities, lookup tables",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -36,14 +36,14 @@
|
|
|
36
36
|
"tool:tangle": "../../node_modules/.bin/tangle src/**/*.ts"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@thi.ng/api": "^8.9.
|
|
39
|
+
"@thi.ng/api": "^8.9.30"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@microsoft/api-extractor": "^7.
|
|
43
|
-
"esbuild": "^0.20.
|
|
42
|
+
"@microsoft/api-extractor": "^7.42.3",
|
|
43
|
+
"esbuild": "^0.20.1",
|
|
44
44
|
"rimraf": "^5.0.5",
|
|
45
|
-
"typedoc": "^0.25.
|
|
46
|
-
"typescript": "^5.
|
|
45
|
+
"typedoc": "^0.25.12",
|
|
46
|
+
"typescript": "^5.4.2"
|
|
47
47
|
},
|
|
48
48
|
"keywords": [
|
|
49
49
|
"align",
|
|
@@ -133,5 +133,5 @@
|
|
|
133
133
|
"transducers-binary"
|
|
134
134
|
]
|
|
135
135
|
},
|
|
136
|
-
"gitHead": "
|
|
136
|
+
"gitHead": "7f3fcbd6c0462b0ce45afa141fe163d1f297fd51\n"
|
|
137
137
|
}
|
package/swizzle.d.ts
CHANGED
|
@@ -77,12 +77,23 @@ export declare const setLane2: (x: number, y: number, lane: Lane2) => number;
|
|
|
77
77
|
* Re-orders byte lanes in given order (MSB).
|
|
78
78
|
*
|
|
79
79
|
* @example
|
|
80
|
-
* ```ts
|
|
81
|
-
* import {
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
*
|
|
85
|
-
*
|
|
80
|
+
* ```ts tangle:../export/swizzle.ts
|
|
81
|
+
* import { swizzle8 } from "@thi.ng/binary";
|
|
82
|
+
*
|
|
83
|
+
* console.log(
|
|
84
|
+
* swizzle8(0x12345678, 3, 2, 1, 0).toString(16)
|
|
85
|
+
* );
|
|
86
|
+
* // 0x78563412
|
|
87
|
+
*
|
|
88
|
+
* console.log(
|
|
89
|
+
* swizzle8(0x12345678, 1, 0, 3, 2).toString(16)
|
|
90
|
+
* );
|
|
91
|
+
* // 0x34127856
|
|
92
|
+
*
|
|
93
|
+
* console.log(
|
|
94
|
+
* swizzle8(0x12345678, 2, 2, 0, 0).toString(16)
|
|
95
|
+
* );
|
|
96
|
+
* // 0x56561212
|
|
86
97
|
* ```
|
|
87
98
|
*
|
|
88
99
|
* @param x - value
|
|
@@ -110,13 +121,17 @@ export declare const swizzle4: (x: number, a: Lane4, b: Lane4, c: Lane4, d: Lane
|
|
|
110
121
|
* are set.
|
|
111
122
|
*
|
|
112
123
|
* @example
|
|
113
|
-
* ```ts
|
|
124
|
+
* ```ts tangle:../export/mux.ts
|
|
114
125
|
* import { mux } from "@thi.ng/binary";
|
|
115
126
|
*
|
|
116
|
-
*
|
|
127
|
+
* console.log(
|
|
128
|
+
* mux(0x12345678, 0xaaaa5555, 0xffff0000)
|
|
129
|
+
* );
|
|
117
130
|
* // 0xaaaa5678
|
|
118
131
|
*
|
|
119
|
-
*
|
|
132
|
+
* console.log(
|
|
133
|
+
* mux(0x12345678, 0xaaaa5555, 0x0000ffff)
|
|
134
|
+
* );
|
|
120
135
|
* // 0x12345555
|
|
121
136
|
* ```
|
|
122
137
|
*
|
|
@@ -135,10 +150,12 @@ export declare const flip8: FnN;
|
|
|
135
150
|
* Swaps the highest & lowest 16 bits in `x`.
|
|
136
151
|
*
|
|
137
152
|
* @example
|
|
138
|
-
* ```ts
|
|
153
|
+
* ```ts tangle:../export/flip16.ts
|
|
139
154
|
* import { flip16 } from "@thi.ng/binary";
|
|
140
155
|
*
|
|
141
|
-
*
|
|
156
|
+
* console.log(
|
|
157
|
+
* flip16(0x12345678).toString(16)
|
|
158
|
+
* );
|
|
142
159
|
* // 0x56781234
|
|
143
160
|
* ```
|
|
144
161
|
*
|