mirror of
https://github.com/wader/fq.git
synced 2024-12-23 13:22:58 +03:00
c93301fc70
raw format was a hack to skip decoding to be able to get a binary using tobyte etc. Now you can do fq -d bytes ... instead of fq -d raw 'tobytes | ...'
297 B
297 B
Decode to a slice and indexable binary of bits.
Slice and decode bit range
$ echo 'some {"a":1} json' | fq -d bits '.[40:-48] | fromjson'
{
"a": 1
}
Index bits
✗ echo 'hello' | fq -d bits '.[4]'
1
$ echo 'hello' | fq -c -d bits '[.[range(8)]]'
[0,1,1,0,1,0,0,0]