We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8665c98 commit 7508ec5Copy full SHA for 7508ec5
README.md
@@ -1,2 +1,25 @@
1
# BinaryToJSON
2
-format binary data to JSON.
+A Deno module helper class that convert binary array buffer to JSON format.
3
+Binary interpretation is defined by JSON.
4
+
5
+This module depends on https://deno.land/x/binary_reader@v0.1.6/mod.ts .
6
7
+## Usage
8
+```typescript
9
+import { BinaryToJSON } from "./binary_to_json.ts";
10
11
+const buffer = new ArrayBuffer(4);
12
+const arry = new Uint8Array(buffer);
13
+arry[0] = 0x0A;
14
+arry[1] = 0x0B;
15
+arry[2] = 0x0C;
16
+arry[3] = 0x0D;
17
+const format = [{"dat": 4}];
18
+const b2j = new BinaryToJSON();
19
+const data: any = b2j.convert(arry, format); // default endian is big
20
21
+// => {"dat": 168496141 } # 0x0A0B0C0D
22
+```
23
24
25
+more info: please refer to test.ts.
0 commit comments