bireader 3.1.15 → 4.0.1
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/README.md +428 -210
- package/_test_reader.cjs +38 -0
- package/_test_writer.mjs +8 -0
- package/dist/index.browser.d.ts +8628 -1434
- package/dist/index.browser.js +16255 -3816
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs.d.ts +3060 -2019
- package/dist/index.cjs.js +8583 -6901
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +3060 -2019
- package/dist/index.esm.d.ts +3060 -2019
- package/dist/index.esm.js +8581 -6902
- package/dist/index.esm.js.map +1 -1
- package/package.json +21 -4
- package/rollup.config.mjs +81 -0
package/_test_reader.cjs
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
|
|
2
|
+
const { BiWriter, BiReaderAsync } = require('./dist/index.cjs.js');
|
|
3
|
+
|
|
4
|
+
const FLOAT32_MAX = 3.4028234663852886e+38;
|
|
5
|
+
|
|
6
|
+
const FLOAT32_MIN = -FLOAT32_MAX;
|
|
7
|
+
|
|
8
|
+
const FLOAT64_MAX = Number.MAX_VALUE;
|
|
9
|
+
|
|
10
|
+
const FLOAT64_MIN = -FLOAT64_MAX;
|
|
11
|
+
|
|
12
|
+
const hasBigInt = typeof BigInt === 'function';
|
|
13
|
+
|
|
14
|
+
const MIN_SAFE_BIGINT = hasBigInt ? BigInt(Number.MIN_SAFE_INTEGER) : 0;
|
|
15
|
+
|
|
16
|
+
const MAX_SAFE_BIGINT = hasBigInt ? BigInt(Number.MAX_SAFE_INTEGER) : 0;
|
|
17
|
+
|
|
18
|
+
const buffer = Buffer.from([0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07]);
|
|
19
|
+
|
|
20
|
+
const array = new Uint8Array([0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07]);
|
|
21
|
+
|
|
22
|
+
const array2 = new Uint8Array(array);
|
|
23
|
+
|
|
24
|
+
const array3 = new Uint8Array(buffer);
|
|
25
|
+
|
|
26
|
+
const windowSize = 1500;
|
|
27
|
+
|
|
28
|
+
const dif = 2000;
|
|
29
|
+
|
|
30
|
+
var increaseSize = 0;
|
|
31
|
+
|
|
32
|
+
if(windowSize != 0 && windowSize > dif) {
|
|
33
|
+
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
console.log(increaseSize);
|
|
38
|
+
|
package/_test_writer.mjs
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import {BiReader, BiReaderAsync, BiWriterStream, BiWriter, hexdump} from './dist/index.esm.js';
|
|
2
|
+
//const filePath = "./test.bin";
|
|
3
|
+
(async function () {
|
|
4
|
+
const bw = new BiReaderAsync(Buffer.alloc(8));
|
|
5
|
+
await bw.open()
|
|
6
|
+
await bw.writeInt64BE(-9174043789562546760n);
|
|
7
|
+
console.log(await bw.get())
|
|
8
|
+
})();
|