@thi.ng/bitstream 2.2.48 → 2.2.50
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 +6 -13
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -1,16 +1,5 @@
|
|
|
1
1
|
<!-- This file is generated - DO NOT EDIT! -->
|
|
2
2
|
<!-- Please see: https://github.com/thi-ng/umbrella/blob/develop/CONTRIBUTING.md#changes-to-readme-files -->
|
|
3
|
-
> [!IMPORTANT]
|
|
4
|
-
> ‼️ Announcing the thi.ng user survey 2024 📋
|
|
5
|
-
>
|
|
6
|
-
> [Please participate in the survey here!](https://forms.gle/XacbSDEmQMPZg8197)\
|
|
7
|
-
> (open until end of February)
|
|
8
|
-
>
|
|
9
|
-
> **To achieve a better sample size, I'd highly appreciate if you could
|
|
10
|
-
> circulate the link to this survey in your own networks.**
|
|
11
|
-
>
|
|
12
|
-
> [Discussion](https://github.com/thi-ng/umbrella/discussions/447)
|
|
13
|
-
|
|
14
3
|
# 
|
|
15
4
|
|
|
16
5
|
[](https://www.npmjs.com/package/@thi.ng/bitstream)
|
|
@@ -22,7 +11,7 @@
|
|
|
22
11
|
> of the [@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo
|
|
23
12
|
> and anti-framework.
|
|
24
13
|
>
|
|
25
|
-
> 🚀
|
|
14
|
+
> 🚀 Please help me to work full-time on these projects by [sponsoring me on
|
|
26
15
|
> GitHub](https://github.com/sponsors/postspectacular). Thank you! ❤️
|
|
27
16
|
|
|
28
17
|
- [About](#about)
|
|
@@ -101,6 +90,8 @@ but JS can only represent integers (w/o loss of precision) up to
|
|
|
101
90
|
technically the max. supported word width is 64 bits.
|
|
102
91
|
|
|
103
92
|
```ts
|
|
93
|
+
import { BitOutputStream } from "@thi.ng/bitstream";
|
|
94
|
+
|
|
104
95
|
out = new BitOutputStream();
|
|
105
96
|
// write 3-bit number (only the lowest 3 bits are used, here 0x05)
|
|
106
97
|
out.write(0xf5, 3);
|
|
@@ -140,7 +131,7 @@ Using `input.seek(pos)`, the read position can be repositioned within
|
|
|
140
131
|
stream limits.
|
|
141
132
|
|
|
142
133
|
```ts
|
|
143
|
-
// get input from output stream...
|
|
134
|
+
// get input from output stream (see above)...
|
|
144
135
|
// (for reference, the ^ indicate the start of each bit field)
|
|
145
136
|
[...out.reader()].join("")
|
|
146
137
|
// "10111001101101111011001010111110111010110110101010101010100101010101010101"
|
|
@@ -160,6 +151,8 @@ out.reader().readStruct([["a", 3], ["b", 7], ["c", 32], ["d", 16], ["e", 16]]);
|
|
|
160
151
|
out.reader().seek(10).readWords(4, 16).map(x=>x.toString(16));
|
|
161
152
|
// [ 'deca', 'fbad', 'aaaa', '5555' ]
|
|
162
153
|
|
|
154
|
+
import { BitInputStream } from "@thi.ng/bitstream";
|
|
155
|
+
|
|
163
156
|
src = new Uint8Array([0xf1,0xe2,0xd3,0xc4,0xb5,0xa6,0x97,0x88]);
|
|
164
157
|
// create stream from bit 36
|
|
165
158
|
input = new BitInputStream(src, 36);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/bitstream",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.50",
|
|
4
4
|
"description": "ES6 iterator based read/write bit streams with support for variable word widths",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"test": "bun test"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@thi.ng/errors": "^2.4.
|
|
38
|
+
"@thi.ng/errors": "^2.4.19"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@microsoft/api-extractor": "^7.40.1",
|
|
@@ -81,5 +81,5 @@
|
|
|
81
81
|
"rle-pack"
|
|
82
82
|
]
|
|
83
83
|
},
|
|
84
|
-
"gitHead": "
|
|
84
|
+
"gitHead": "df9e312af741d87e6b450afcfea6a6e381662b1e\n"
|
|
85
85
|
}
|