Closed dolio closed 2 years ago
Just swapped out uses of toBase32
with base32Hex
in the scheme stuff, and now I get output for references that I can successfully look up with find
in ucm. So that seems like a good indication that it's actually working as expected.
Merged into base v4 branch. 🌈 ⭐
This PR adds functions for encoding bytes using base 32 hex encoding. This encoding extends the usual hexadecimal digits rather than starting at A. Both encoding and decoding are written in unison, with an encoding function to both
Text
andBytes
, and a decoding function fromBytes
.When writing tests, using
Gen
didn't seem to give very good coverage of byte/hex strings, so I cloned some helpfulGen
functions as the better performingRandom
ability. On top of that, I built a random generator for base 32 hex byte strings that represent byte-aligned source values. That is used to test that the round-trip through encoding and decoding gives back the original result.I believe I've documented everything, too. Let me know if any changes are necessary.
Code review
The changes summarized below are available for you to review, using the following command:
Added definitions:
The changes summarized below are available for you to review, using the following command:
ub.com/dolio/unison-codebase:.base.hex32 Added definitions: