Repository navigation
codecs: z-base-32, the format of pkarr's keys - #6
Merged
Merged
Conversation
added 5 commits
December 4, 2026 00:21
… codec and stream codec in detail/formats/base32_codec.hpp
…tion over its own alphabet, constant time and streaming, tested against pkarr's vectors
… zbase32_decode and zbase32_encode with their A/A controls, the fuzz target with its corpus
…karr.cpp, the tables, the changelog's line
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
formats::zbase32(<webcpp/codecs/zbase32.hpp>): z-base-32, the format pkarr writes its Ed25519 keys in (32 bytes as 52 characters), which iroh reaches through pkarr. Design: webcpporg/proposals,libraries/codecs/openspec/changes/zbase32/(D1 to D3, rulings R1 to R10).What
bool Hex(base32_alphabet<Hex>,zbase32_alphabet); the codec and stream codec move todetail/formats/base32_codec.hpp. base32's behaviour and tests are unchanged.secure::constant_time::lookup, a symbol's value byis_equal_maskagainst the 32 symbols, as bech32's; constant time on every call, streaming natively.=and other characters areinvalid_character), a remainder of 1, 3 or 6 isinvalid_length, non-zero trailing bits areinvalid_padding. pkarr's decoder (cratebase320.5.1) ignores trailing bits and truncates bad lengths; codecs refuses them.text<52>,text<52>decodes intobytes<32>.3dca339(its key with bytes, its other keys, its refused keys) and the z-base-32 document's byte examples, with provenance intest/zbase32_vectors.hpp; a plain reference against every byte at every place and 5000 near-valid texts; the stream test;noexcept, allocation and<windows.h>tests.zbase32_decode/zbase32_encodewith A/A controls; the fuzz targetzbase32with 35 corpus inputs.example/zbase32_pkarr.cpp, the tables, the changelog line (merged into base32's to keep ten lines).Local verification (head e55940b)
libs/codecs/test,example,test/fuzz: 0 failed.b2 libs/codecs/doc: built.🤖 Generated with Claude Code