You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/usage.md
+9-6Lines changed: 9 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -55,6 +55,8 @@ fq -Vr .path.to.string file
55
55
fq -o bits_format=truncate tovalue file
56
56
# JSON but raw bit fields as md5 hex string
57
57
fq -o bits_format=md5 tovalue file
58
+
# JSON but raw bit fields as byte arrays
59
+
fq -o bits_format=byte_array tovalue file
58
60
# look up a path
59
61
fq '.some[1].path' file
60
62
# look up a path and output JSON
@@ -403,8 +405,8 @@ There is also `tobitsrange` and `tobytesrange` which does the same thing but wil
403
405
-`[0x12, 0x34, 0x56] | tobits[4:12]` will be a binary with the byte `0x23`
404
406
-`[0x12, 0x34, 0x56] | tobits[4:20]` will be a binary with the byte `0x23`, `0x45`
405
407
-`[0x12, 0x34, 0x56] | tobits[4:20] | tobytes[1:]` will be a binary with the byte `0x45`,
406
-
407
-
Both `.[index]` and `.[start:end]` support negative indices to index from end.
408
+
- Both `.[index]` and `.[start:end]` support negative indices to index from end.
409
+
-`explode` output an array with all byte or bits as integers.
408
410
409
411
#### Binary array
410
412
@@ -898,12 +900,13 @@ fq has some general options in addition to decode and decoders specific options.
898
900
899
901
How to represent raw binary as JSON.
900
902
901
-
-`-o bits_format=string` String with raw bytes (zero bit padded if size is not byte aligned). The string is binary safe internally in fq but bytes not representable as UTF-8 will be lost if turn to JSON.
902
-
-`-o bits_format=md5` MD5 hex string (zero bit padded).
903
-
-`-o bits_format=hex` Hex string.
904
903
-`-o bits_format=base64` Base64 string.
905
-
-`-p bits_format=truncate` Truncated string.
904
+
-`-o bits_format=byte_array` Array of bytes (zero bit padded if size is not byte aligned).
905
+
-`-o bits_format=hex` Hex string.
906
+
-`-o bits_format=md5` MD5 hex string (zero bit padded).
906
907
-`-o bits_format=snippet` Truncated Base64 string prefixed with bit length.
908
+
-`-o bits_format=string` String with raw bytes (zero bit padded if size is not byte aligned). The string is binary safe internally in fq but bytes not representable as UTF-8 will be lost if turn into JSON (default).
0 commit comments