@thi.ng/binary 3.4.42 → 3.4.44
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/README.md +1 -1
- package/edit.d.ts +2 -2
- package/float.d.ts +9 -8
- package/gray.d.ts +2 -2
- package/int.d.ts +2 -2
- package/package.json +5 -5
- package/swizzle.d.ts +6 -6
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
[](https://mastodon.thi.ng/@toxi)
|
|
8
8
|
|
|
9
9
|
> [!NOTE]
|
|
10
|
-
> This is one of
|
|
10
|
+
> This is one of 202 standalone projects, maintained as part
|
|
11
11
|
> of the [@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo
|
|
12
12
|
> and anti-framework.
|
|
13
13
|
>
|
package/edit.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import type { Bit } from "./api.js";
|
|
|
4
4
|
* Clears bit in given uint `x`.
|
|
5
5
|
*
|
|
6
6
|
* @param x - value
|
|
7
|
-
* @param bit - bit number (0
|
|
7
|
+
* @param bit - bit number `(0,31)`
|
|
8
8
|
*/
|
|
9
9
|
export declare const bitClear: (x: number, bit: Bit) => number;
|
|
10
10
|
/**
|
|
@@ -18,7 +18,7 @@ export declare const bitFlip: (x: number, bit: Bit) => number;
|
|
|
18
18
|
* Sets bit in given uint `x`.
|
|
19
19
|
*
|
|
20
20
|
* @param x - value
|
|
21
|
-
* @param bit - bit number (0
|
|
21
|
+
* @param bit - bit number `(0,31)`
|
|
22
22
|
*/
|
|
23
23
|
export declare const bitSet: (x: number, bit: Bit) => number;
|
|
24
24
|
export declare const bitSetWindow: (x: number, y: number, from: number, to: number) => number;
|
package/float.d.ts
CHANGED
|
@@ -8,15 +8,15 @@ export declare const floatToUintBits: FnN;
|
|
|
8
8
|
export declare const intBitsToFloat: FnN;
|
|
9
9
|
export declare const uintBitsToFloat: FnN;
|
|
10
10
|
/**
|
|
11
|
-
* Returns i32 representation of f64 as [hi, lo] tuple (takes
|
|
12
|
-
*
|
|
11
|
+
* Returns i32 representation of f64 as `[hi, lo]` tuple (takes environment's
|
|
12
|
+
* Little Endianess into account).
|
|
13
13
|
*
|
|
14
14
|
* @param x -
|
|
15
15
|
*/
|
|
16
16
|
export declare const floatToIntBits64: (x: number) => [number, number];
|
|
17
17
|
/**
|
|
18
|
-
* Returns u32 representation of f64 as [hi, lo] tuple (takes
|
|
19
|
-
*
|
|
18
|
+
* Returns u32 representation of f64 as `[hi, lo]` tuple (takes environment's
|
|
19
|
+
* Little Endianess into account).
|
|
20
20
|
*
|
|
21
21
|
* @param x -
|
|
22
22
|
*/
|
|
@@ -41,6 +41,7 @@ export declare const uintBitsToFloat64: FnN2;
|
|
|
41
41
|
*
|
|
42
42
|
* @remarks
|
|
43
43
|
* References:
|
|
44
|
+
*
|
|
44
45
|
* - https://github.com/tzaeschke/phtree/blob/develop/PhTreeRevisited.pdf (page
|
|
45
46
|
* 3)
|
|
46
47
|
*
|
|
@@ -48,25 +49,25 @@ export declare const uintBitsToFloat64: FnN2;
|
|
|
48
49
|
*/
|
|
49
50
|
export declare const floatToSortableInt: FnN;
|
|
50
51
|
/**
|
|
51
|
-
* Converts normalized float ([-1
|
|
52
|
+
* Converts normalized float (`[-1,1]` range) to u8.
|
|
52
53
|
*
|
|
53
54
|
* @param x -
|
|
54
55
|
*/
|
|
55
56
|
export declare const f32u8: FnN;
|
|
56
57
|
/**
|
|
57
|
-
* Converts normalized float ([-1
|
|
58
|
+
* Converts normalized float (`[-1,1]` range) to u16.
|
|
58
59
|
*
|
|
59
60
|
* @param x -
|
|
60
61
|
*/
|
|
61
62
|
export declare const f32u16: FnN;
|
|
62
63
|
/**
|
|
63
|
-
* Converts normalized float ([-1
|
|
64
|
+
* Converts normalized float (`[-1,1]` range) to u24.
|
|
64
65
|
*
|
|
65
66
|
* @param x -
|
|
66
67
|
*/
|
|
67
68
|
export declare const f32u24: FnN;
|
|
68
69
|
/**
|
|
69
|
-
* Converts normalized float ([-1
|
|
70
|
+
* Converts normalized float (`[-1,1]` range) to u32.
|
|
70
71
|
*
|
|
71
72
|
* @param x -
|
|
72
73
|
*/
|
package/gray.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import type { FnN } from "@thi.ng/api";
|
|
|
6
6
|
*
|
|
7
7
|
* @remarks
|
|
8
8
|
* Reference:
|
|
9
|
-
*
|
|
9
|
+
* https://en.wikipedia.org/wiki/Gray_code
|
|
10
10
|
*
|
|
11
11
|
* @param x - u32
|
|
12
12
|
*/
|
|
@@ -16,7 +16,7 @@ export declare const encodeGray32: FnN;
|
|
|
16
16
|
*
|
|
17
17
|
* @remarks
|
|
18
18
|
* Reference:
|
|
19
|
-
*
|
|
19
|
+
* https://en.wikipedia.org/wiki/Gray_code
|
|
20
20
|
*/
|
|
21
21
|
export declare const decodeGray32: FnN;
|
|
22
22
|
//# sourceMappingURL=gray.d.ts.map
|
package/int.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { FnN } from "@thi.ng/api";
|
|
2
2
|
/**
|
|
3
3
|
* Converts signed i8 to unsigned u8 value. Input is assumed to be in
|
|
4
|
-
* [-0x80,0x7f] range. Does NOT perform clamping. Branchless.
|
|
4
|
+
* `[-0x80,0x7f]` range. Does NOT perform clamping. Branchless.
|
|
5
5
|
*
|
|
6
6
|
* @param x
|
|
7
7
|
* @returns
|
|
@@ -9,7 +9,7 @@ import type { FnN } from "@thi.ng/api";
|
|
|
9
9
|
export declare const i8u8: FnN;
|
|
10
10
|
/**
|
|
11
11
|
* Converts signed i16 to unsigned u16 value. Input is assumed to be in
|
|
12
|
-
* [-0x8000,0x7fff] range. Does NOT perform clamping. Branchless.
|
|
12
|
+
* `[-0x8000,0x7fff]` range. Does NOT perform clamping. Branchless.
|
|
13
13
|
*
|
|
14
14
|
* @param x
|
|
15
15
|
* @returns
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/binary",
|
|
3
|
-
"version": "3.4.
|
|
3
|
+
"version": "3.4.44",
|
|
4
4
|
"description": "100+ assorted binary / bitwise operations, conversions, utilities, lookup tables",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -39,11 +39,11 @@
|
|
|
39
39
|
"tool:tangle": "../../node_modules/.bin/tangle src/**/*.ts"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@thi.ng/api": "^8.11.
|
|
42
|
+
"@thi.ng/api": "^8.11.21"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"esbuild": "^0.
|
|
46
|
-
"typedoc": "^0.27.
|
|
45
|
+
"esbuild": "^0.25.0",
|
|
46
|
+
"typedoc": "^0.27.7",
|
|
47
47
|
"typescript": "^5.7.3"
|
|
48
48
|
},
|
|
49
49
|
"keywords": [
|
|
@@ -133,5 +133,5 @@
|
|
|
133
133
|
"transducers-binary"
|
|
134
134
|
]
|
|
135
135
|
},
|
|
136
|
-
"gitHead": "
|
|
136
|
+
"gitHead": "bee617702ac61d093465b967f8f973dc566faa6b\n"
|
|
137
137
|
}
|
package/swizzle.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { FnN, FnN3 } from "@thi.ng/api";
|
|
2
2
|
import type { Lane16, Lane2, Lane4, Lane8 } from "./api.js";
|
|
3
3
|
/**
|
|
4
|
-
* Extracts 16-bit lane from given 32bit uint and returns as unsigned
|
|
5
|
-
*
|
|
4
|
+
* Extracts 16-bit lane from given 32bit uint and returns as unsigned half word
|
|
5
|
+
* `[0x0000,0xffff]`.
|
|
6
6
|
*
|
|
7
7
|
* - Lane #0: bits 16-31
|
|
8
8
|
* - Lane #1: bits 0-15
|
|
@@ -12,8 +12,8 @@ import type { Lane16, Lane2, Lane4, Lane8 } from "./api.js";
|
|
|
12
12
|
*/
|
|
13
13
|
export declare const lane16: (x: number, lane: Lane16) => number;
|
|
14
14
|
/**
|
|
15
|
-
* Extracts 8-bit lane from given 32bit uint and returns as unsigned
|
|
16
|
-
*
|
|
15
|
+
* Extracts 8-bit lane from given 32bit uint and returns as unsigned byte
|
|
16
|
+
* `[0x00,0xff]`.
|
|
17
17
|
*
|
|
18
18
|
* - Lane #0: bits 24-31
|
|
19
19
|
* - Lane #1: bits 16-23
|
|
@@ -25,8 +25,8 @@ export declare const lane16: (x: number, lane: Lane16) => number;
|
|
|
25
25
|
*/
|
|
26
26
|
export declare const lane8: (x: number, lane: Lane8) => number;
|
|
27
27
|
/**
|
|
28
|
-
* Extracts 4-bit lane from given 32bit uint and returns as unsigned
|
|
29
|
-
*
|
|
28
|
+
* Extracts 4-bit lane from given 32bit uint and returns as unsigned nibble
|
|
29
|
+
* `[0x00,0x0f]`.
|
|
30
30
|
*
|
|
31
31
|
* - Lane #0: bits 28-31
|
|
32
32
|
* - Lane #1: bits 24-27
|