Releases: nao1215/yabase
Releases · nao1215/yabase
Release list
v0.2.1
Changed
- Replace all custom
list_reverseimplementations withlist.reversefrom stdlib (14 modules) bignum.encode_intnow uses list accumulator instead of O(n^2) string concatenationbignum.count_leading_charrenamed tocount_leading_zeros_strand useschar_valuefor zero alias handling (e.g. Crockford O->0)- Shared
find_indexextracted intobignummodule; Base58 Bitcoin/Flickr deduplicated z85.list_to_stringusesstring.joininstead of recursive concatenationcrockford.string_char_atandnopadding.find_char_posuselet assertfor unreachable branchesverify-readme.shusestrapcleanup and indentation-safe grep patterns- Example comments clarified to note they do not produce real Bitcoin addresses
Fixed
- Base91 EOF decode now flushes one final byte (matching C reference implementation)
urlsafe_nopadding.decodenow reports the earliest invalid character, not just=- Crockford case-insensitive test was a tautology (compared same input to itself)
- README
8-to-5 bitcompound modifier hyphenation corrected to8-to-5-bit
Added
base58checkmiddle-positionInvalidCharactertest
v0.2.0
Added
- Base2 (binary string), Base8 (octal), Base10 (decimal) encodings
- Base58 Flickr variant with multibase
Zprefix - Crockford Base32 check symbol support via
CrockfordCheckvariant andencode_check/decode_check - Multibase prefixes
0(base2),7(base8),9(base10),Z(base58flickr) - Ascii85 btoa
yabbreviation for 4 consecutive spaces (0x20202020) - Adobe Ascii85 form-feed whitespace handling (PostScript compliance)
- NoPadding Base64 decoders now reject
=withInvalidCharacter - Shared
internal/bignummodule for radix-based encodings - NIST test vectors for SHA-256 (448-bit, 896-bit, padding boundary cases)
- Base91 fixed vectors, error cases, and 48/64-byte roundtrip tests
- CI: README code snippet compilation check, examples compile check, OTP 26/27/28 matrix
- Multibase coverage matrix in README
- Examples for JWT, QR, Bitcoin, and multibase use cases
- Leading-zero preservation documented for big-integer encodings
Changed
- BREAKING:
Base58is nowBase58(Bitcoin)in theEncodingADT - BREAKING:
Ascii85,AdobeAscii85,Rfc1924Base85,Z85are nowBase85(Btoa),Base85(Adobe),Base85(Rfc1924),Base85(Z85) - BREAKING:
yabase.decode_asrenamed toyabase.decode - BREAKING:
yabase.encode_with_prefix/yabase.decode(multibase) renamed toyabase.encode_multibase/yabase.decode_multibase - BREAKING:
bech32.encode(hrp, data)/bech32.encode_m(hrp, data)merged intobech32.encode(variant, hrp, data) - BREAKING:
CrockfordCheckadded toBase32Variantfor unified API access - Crockford Base32 now uses number encoding per spec (was byte-stream chunking)
- Bech32 module documentation clarified as byte-payload convenience API
yabase/core/dispatchermarked as internal module- All encoder functions refactored from O(n^2) string concat to O(n) list accumulator
Fixed
- SHA-256 now uses full 64-bit length in padding (was 32-bit)
- Crockford Base32 encoding now matches the published specification
- Base91 data corruption on inputs longer than ~30 bytes (bigint bit-buffer overflow)
- Adobe Ascii85 now accepts form-feed as whitespace per PostScript spec
v0.1.0
Added
- Unified, type-safe
Encodingtype covering 19 binary-to-text encodings - Three API layers: low-level modules, unified dispatch (
yabase.encode/yabase.decode_as), and facade shortcuts - Multibase prefix encoding and auto-detection (
yabase.encode_with_prefix/yabase.decode) - Base16 (hex) encoding and decoding
- Base32 variants: RFC4648, Hex, Crockford, Clockwork, z-base-32
- Base64 variants: Standard, URL-safe, NoPadding, DQ (Dragon Quest hiragana)
- Base36, Base45 (RFC 9285), Base58 (Bitcoin), Base62
- Base91, Ascii85, Adobe Ascii85 (PDF/PostScript), Z85, RFC 1924 Base85
- Base58Check (version byte + SHA-256 double-hash checksum, BIP reference)
- Bech32 (BIP 173) and Bech32m (BIP 350) with separate API (HRP + checksum)
- Pure Gleam SHA-256 implementation for Base58Check checksum computation
CodecErrortype with specific error variants:InvalidCharacter,InvalidLength,Overflow,UnsupportedPrefix,UnsupportedMultibaseEncoding,InvalidChecksum,InvalidHrpDecodedtype for multibase auto-detection resultsBech32Decodedtype with HRP, data, and variant auto-detectionBase58CheckDecodedtype with version byte and payload- Strict input validation: padding position checks (Base32/Base64), trailing data rejection, pure-padding rejection, length constraints (Z85)
- 302 tests covering fixed vectors, roundtrips, error cases, and edge cases