intoto-deserializer
v0.0.6
Published
## Description
Downloads
1
Readme
Intoto Deserializer Package
Description
Intoto Deserializer Package is a NPM package written in typescript that provides a deserializer for the intoto apparatus binary format. The deserializer converts the binary packet into a JSON object to be easier to work with.
Installation
npm install intoto-deserializer
Usage
import { deserialize } from 'intoto-deserializer';
const binary: Buffer;
const json = deserialize(binary);
console.log(json);
// Example output:
// {
// "serial": "IN000000",
// "firmware: "1.0.0",
// "topic": "data,
// "packets": [
// {
// "date": "2022-12-05T21:11:17Z",
// "internals": [
// 21.014480590820312,
// 1015.6759033203125,
// 45.13324737548828
// ],
// "battery": -1,
// "sensor": [
// -1,
// -1,
// -1,
// -1
// ],
// }
// ],
// }