~/runtimelab $ cat ./varint-go/README
Build your own varint
A `uint64` costs eight bytes whether it holds 1 or 18 quintillion. LEB128 makes small numbers small — and it is the encoding under Protocol Buffers, SQLite, DWARF and WebAssembly. Build the codec, then the wire format on top of it, then the parts that face an attacker.
what you end up with
A varint codec and a protobuf-style wire reader
- stages
- 14
- estimated
- 10–15 h
- level
- Intermediate
- track
- Backend Engineering
- language
- Go
- seven payload bits and a continuation bit
- the ten-byte ceiling on a uint64
- zigzag, and why -1 should not cost ten bytes
- field tags — (field number << 3) | wire type
- length-delimited records
- skipping a field you do not understand
- canonical versus over-long encodings
- fixed width against variable width
- decoding from a stream rather than a slice
- a length prefix written by somebody hostile
The stage list opens once you sign in — it is the challenge, not the pitch. Signing in is free, and the first stages of every challenge are too.