https://github.com/uttori/uttori-data-tools
Tools for working with binary data.
https://github.com/uttori/uttori-data-tools
binary data stream uttori
Last synced: 4 months ago
JSON representation
Tools for working with binary data.
- Host: GitHub
- URL: https://github.com/uttori/uttori-data-tools
- Owner: uttori
- Created: 2020-06-13T22:04:24.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2025-10-17T16:53:15.000Z (8 months ago)
- Last Synced: 2025-10-18T19:07:12.740Z (8 months ago)
- Topics: binary, data, stream, uttori
- Language: JavaScript
- Size: 16.2 MB
- Stars: 0
- Watchers: 0
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
[](https://www.npmjs.com/package/@uttori/data-tools)
[](https://www.npmjs.com/package/@uttori/data-tools)
[](https://travis-ci.com/uttori/uttori-data-tools)
[](https://coveralls.io/r/uttori/uttori-data-tools?branch=master)
[](https://bundlephobia.com/result?p=@uttori/data-tools)
[](https://bundlephobia.com/result?p=@uttori/data-tools)
[](https://bundlephobia.com/result?p=@uttori/data-tools)
[](https://bundlephobia.com/result?p=@uttori/data-tools)
# Uttori Data Tools
Tools for working with binary data.
- **CRC32** - Derive the Cyclic Redundancy Check of a data blob.
- **DataStream** - Helpter class to ease parsing binary formats.
- **DataBuffer** - Helper class for working with binary data.
- **DataBufferList** - A linked list of DataBuffers.
- **DataBitstream** - Read a DataStream as a stream of bits.
## Install
```bash
npm install --save @uttori/data-tools
```
* * *
## Examples
```js
import { CRC32, DataBuffer, DataBufferList, DataBitstream, DataStream } from '@uttori/data-tools';
CRC32.of('The quick brown fox jumps over the lazy dog');
➜ '414FA339'
const stream_a = DataStream.fromData(Buffer.from([20, 29, 119]));
const stream_b = DataStream.fromData(Buffer.from([20, 29, 119]));
stream_a.compare(stream_b);
➜ true
const buffer = new DataBuffer(data);
const list = new DataBufferList();
list.append(buffer);
```
## Tree Shaking with ESM Modules
To enable tree-shaking with [RollUp](https://rollupjs.org/), you will likely want to use `replace()` of [@rollup/plugin-replace](https://www.npmjs.com/package/@rollup/plugin-replace) like the following example to get a clean output:
```js
rollup({
input: './you-entry-file.js',
plugins: [
replace({
'process.env.UTTORI_DATA_DEBUG': 'false',
}),
],
});
```
* * *
## Tests
To run the test suite, first install the dependencies, then run `npm test`:
```bash
npm install
npm test
DEBUG=Uttori* npm test
```
## Contributors
- [Matthew Callis](https://github.com/MatthewCallis)
## License
- [MIT](LICENSE)