Improved binary slicing and bit reading, avro_ocf
decoder (thanks @xentripetal), asn1_ber
decoder, renamed display
aliases, new grep_by
and paste
function.
Changes
- Big internal bit reader refactor. Now much more consistent code and fixes some issues reading and decoding of binary arrays and binary slices. #123
- Bit reading and IO have been moved to a
bitio
package. - Non-simple bit reading have been move out of
bitio
todecode
package. [0,1,1,0,0,1,1,0,0,1,1,1,0,0,0,1 | tobits] | tobytes | tostring
returns"fq"
.[.frames[0], .frames[-1]] | mp3
decode mp3 based on first and last frame of other mp3.
- Bit reading and IO have been moved to a
- Add
grep_by
that recursively selects using a filter condition and ignores errors. #102grep_by(.type == "trak")
finds all objects where.type
is "trak" (all mp4 track boxes).grep_by(tonumber | . >= 40 and . <= 100)
find all numbers between 40 and 100.grep_by(format == "jpeg")
find all jpegs.
- Add
paste
function to read string from stdin util ^D (EOF). Can be used to paste in REPl etc. #143paste | frompem | asn1_ber | repl
wait for PEM encoded text on stdin (paste and press ^D), decode it withasn1_ber
and start a sub-REPL with the result.paste | fromjson
decode pasted JSON.eval(paste)
eval pasted jq expression.
- Cleanup display aliases. Remove
v
andf
, addda
,dd
,dv
andddv
. #112d
/d($opts)
display value and truncate long arrays and buffersda
/da($opts)
display value and don't truncate arraysdd
/dd($opts)
display value and don't truncate arrays or buffersdv
/dv($opts)
verbosely display value and don't truncate arrays but truncate buffersddv
/ddv($opts)
verbosely display value and don't truncate arrays or buffers
- Refactor
radix
intotoradix($base)
/fromradix($base)
. #139 - Remove
number_to_bytes
. Can be done withtobytes
. #139 - Change
tobytes
to zero pad most significant bits to byte alignment if needed. #133 - Add
tobytes
/tobits
variant that takes an argument to add extra padding. #1330xf | tobytes
8 bit binary with last 4 bits set0xf | tobytes(4)
32 bit binary with last 4 bits set0xf | tobits(12)
12 bit binary with last 4 bits set
- Rename fq type buffer to binary as it makes more sense. #133
- Add
topem
/frompem
to work with PEM encoding. #92 - Add Windows scoop install. #137 Thanks @thushan
- Add
display
, decode value, binary and binary array documentation. #118 #136 #133 - Add decode API documentation. #149
- Improved REPL completion for keys. #144
- Add
-o force=<bool>
option that sets force decode option. Same asmp4({force: true})
. #126
Decoder changes
avro_ocf
Add decoder. #38 Thanks @xentripetal- Full avro OCF support. Handles all primitive, complex, and logical types besides decimals.
- Able to handle deflate, snappy, and null codecs for blocks.
asn1_ber
Add decoder. #92- Also decodes CER and DER (X.690) but with no additional validation at the moment.
- Support all types but real type is currently limited to range for 64 bit interger/float.
- Has
torepr
support. - No schema support.
aac_frame
Only decode object types we know about. #130mp3
Shorter sync find heuristics. #104mp4
Addstz2
supportmp4
Addpnot
(preview container) andjP
(JPEG 2000) signature. #125
Also thanks to @Doctor-love for keeping things tidy.
(Some commits have been removed from list for clarity)
Changelog