|
4 | 4 |
|
5 | 5 | ### Features |
6 | 6 |
|
7 | | -- Wire codec (`Varint`, `ZigZag`, `Tag`, `WireType`), framing + scalar |
8 | | - codecs (`WireReader`, `WireWriter`, `Scalar`, `LE`), UTF-8 validator, |
9 | | - typed `WireError` union. 54 tests including property-based roundtrips |
10 | | - for every protobuf scalar and fuzz tests on the readers. |
| 7 | +- **Varint codec** — `Varint` encodes/decodes unsigned varints; |
| 8 | + `ZigZag` handles sint32/sint64 zig-zag encoding. |
| 9 | +- **Tag codec** — `Tag` and `TagCodec` encode/decode field-number + wire-type |
| 10 | + pairs; `TagDecoded` carries the result. |
| 11 | +- **Wire types** — `WireType` union (`WireVarint`, `WireFixed64`, |
| 12 | + `WireLenDelim`, `WireFixed32`) with `WireTypeFromValue` dispatcher. |
| 13 | +- **Scalar codec** — `Scalar` covers all proto3 scalar types (bool, |
| 14 | + int32/64, uint32/64, sint32/64, fixed32/64, sfixed32/64, float, double, |
| 15 | + string, bytes), mapping each to its correct wire encoding. |
| 16 | +- **Little-endian framing** — `LE` reads/writes 32- and 64-bit fixed values. |
| 17 | +- **Streaming reader/writer** — `WireReader` and `WireWriter` provide |
| 18 | + sequential encode/decode over `Array[U8]` buffers. |
| 19 | +- **UTF-8 validator** — rejects invalid byte sequences before they reach |
| 20 | + string fields. |
| 21 | +- **Typed errors** — `WireError` union (`WireTruncated`, `WireOverflow`, |
| 22 | + `WireBadTag`, `WireInvalidUtf8`) gives callers precise failure reasons. |
| 23 | +- 54 tests including property-based roundtrips for every scalar type and |
| 24 | + fuzz tests confirming arbitrary bytes never panic the readers. |
0 commit comments