@thi.ng/bitstream 2.2.49 → 2.2.51
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 +5 -1
- package/package.json +5 -4
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -90,6 +90,8 @@ but JS can only represent integers (w/o loss of precision) up to
|
|
|
90
90
|
technically the max. supported word width is 64 bits.
|
|
91
91
|
|
|
92
92
|
```ts
|
|
93
|
+
import { BitOutputStream } from "@thi.ng/bitstream";
|
|
94
|
+
|
|
93
95
|
out = new BitOutputStream();
|
|
94
96
|
// write 3-bit number (only the lowest 3 bits are used, here 0x05)
|
|
95
97
|
out.write(0xf5, 3);
|
|
@@ -129,7 +131,7 @@ Using `input.seek(pos)`, the read position can be repositioned within
|
|
|
129
131
|
stream limits.
|
|
130
132
|
|
|
131
133
|
```ts
|
|
132
|
-
// get input from output stream...
|
|
134
|
+
// get input from output stream (see above)...
|
|
133
135
|
// (for reference, the ^ indicate the start of each bit field)
|
|
134
136
|
[...out.reader()].join("")
|
|
135
137
|
// "10111001101101111011001010111110111010110110101010101010100101010101010101"
|
|
@@ -149,6 +151,8 @@ out.reader().readStruct([["a", 3], ["b", 7], ["c", 32], ["d", 16], ["e", 16]]);
|
|
|
149
151
|
out.reader().seek(10).readWords(4, 16).map(x=>x.toString(16));
|
|
150
152
|
// [ 'deca', 'fbad', 'aaaa', '5555' ]
|
|
151
153
|
|
|
154
|
+
import { BitInputStream } from "@thi.ng/bitstream";
|
|
155
|
+
|
|
152
156
|
src = new Uint8Array([0xf1,0xe2,0xd3,0xc4,0xb5,0xa6,0x97,0x88]);
|
|
153
157
|
// create stream from bit 36
|
|
154
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.51",
|
|
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",
|
|
@@ -32,10 +32,11 @@
|
|
|
32
32
|
"doc:ae": "mkdir -p .ae/doc .ae/temp && api-extractor run --local --verbose",
|
|
33
33
|
"doc:readme": "bun ../../tools/src/module-stats.ts && bun ../../tools/src/readme.ts",
|
|
34
34
|
"pub": "yarn npm publish --access public",
|
|
35
|
-
"test": "bun test"
|
|
35
|
+
"test": "bun test",
|
|
36
|
+
"tool:tangle": "../../node_modules/.bin/tangle src/**/*.ts"
|
|
36
37
|
},
|
|
37
38
|
"dependencies": {
|
|
38
|
-
"@thi.ng/errors": "^2.4.
|
|
39
|
+
"@thi.ng/errors": "^2.4.20"
|
|
39
40
|
},
|
|
40
41
|
"devDependencies": {
|
|
41
42
|
"@microsoft/api-extractor": "^7.40.1",
|
|
@@ -81,5 +82,5 @@
|
|
|
81
82
|
"rle-pack"
|
|
82
83
|
]
|
|
83
84
|
},
|
|
84
|
-
"gitHead": "
|
|
85
|
+
"gitHead": "a421058a65ba76608d94129ac29451bfedaf201c\n"
|
|
85
86
|
}
|