BinaryTypes is a library with classes representing binary data types like bool, int, uint or string.
npm install @lukaswozniak/binarytypesBinaryTypes is a library with classes representing binary data types like bool, int, uint or string.
$ npm install @lukaswozniak/binarytypes
``typescript
import { Bool, UInt32 } from "@lukaswozniak/binarytypes"
// create objects
const trueBoolean = new Bool(true);
const falseBoolean = new Bool(Buffer.from([0]));
const uint = new UInt32(12345);
const uint2 = new UInt32(Buffer.from([0x39, 0x30]));
// read values
const trueValue: boolean = trueBoolean.value;
const value12345: number = uint.value;
const data12345: Buffer = uint.data;
``