Releases: theseyan/bufzilla
Releases · theseyan/bufzilla
v0.3.2
- Change signed varint encoding to signed-magnitude via
varIntSignedPositive/varIntSignedNegativetags (replaces the need for ZigZag encoding). - Add compact tags for very small values:
smallIntPositive/smallIntNegative(inline magnitude 0..7 in tag byte)smallUint(inline unsigned 0..7 in tag byte)smallBytes(inline length 0..7 in tag byte)
- Add
typedArrayfor packed numeric vectors. - Add native
f16float value encoding. - Fix
Reader.readPath/Reader.readPathsobject size limit enforcement when encountering non-byte keys. - Refactor code to reduce duplication.
v0.3.1
- Added
Reader.readPathfor fast path-based queries on encoded data using Javascript-style property access:"name","address.city","items[0]","users[5].scores[0]". - Added
Reader.readPathsfor efficiently reading a list of paths in a single pass. - Added
Writer.applyUpdatesfor efficiently applying a changeset of updates to an existing encoded buffer in a single pass.
Improvements
- Refactored and simplified some logic in
Reader.zig
v0.3.0
- Upgrade to Zig 0.15.2
Writernow accepts a*std.Io.Writerinstead of an allocator.Inspectnow accepts a*std.Io.Writerinstead of the deprecatedstd.io.AnyWriter.- Removed
Writer.deinit(),Writer.bytes(),Writer.len(),Writer.toOwnedSlice()in favor ofstd.Io.Writer.
Safety
- Added configurable
ReadLimitswith the following options:max_depth: maximum nesting depth for containersmax_bytes_length: maximum string/binary blob sizemax_array_length: maximum array element countmax_object_size: maximum object key-value pair count
- New errors:
MaxDepthExceeded,BytesTooLong,ArrayTooLarge,ObjectTooLarge. Inspect.printValuenow returnsNonFiniteFloaterror for NaN and Infinity float value.
Benchmarks
- A benchmark suite has been added (mostly ported from zig-msgpack).
Bugfixes and Optimizations
- Fix integer overflow in
Readerbounds checks that could bypass validation with malicious length values. - Fix
Readerdepth underflow when encounteringcontainerEndat depth 0. - Fix
Readerfloat decoding to use little-endian byte order always. - Fix
InspectJSON output to escape all control characters (0x00-0x1F). - Fix
encodeVarIntcomputing wrong size on big-endian machines. Inspectnow returnserror.InvalidUtf8for non-UTF-8 byte sequences instead of producing invalid JSON.- Fix integer overflow in
Writer.writewhen writing extremely large integers. - Fix
Writer.writeAnysilently dropping pointer-to-array values like&[_]u8{1,2,3}(data loss). - Optimize: pre-compute key field for struct serialization.
v0.2.1
- Compatible with Zig 0.14.1
- Fix an issue in
build.zigpreventing compilation in macOS hosts.
v0.2.0
- Upgrade to Zig 0.14
- Simple variable length integer encoding (strictly better space efficiency) by prefixing length in the tag byte.
- Use ZigZag algorithm for efficiently encoding negative variable integers.
- Rename
stringtype tobytesbecause a string is just an array of bytes. Also makes it clear that the type is meant for arbitrary binary values, not just strings. We don't want multiple "bytes" types like in MessagePack. boolis now stored directly inside it's tag, saving 1 byte per bool.- Change runtime
error.UnsupportedTypes to compile errors where possible. - Rename to
bufzillabecause the old name was similar to Z-buffers (term in 3-D graphics programming).