Python3 implementation #3
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/kb20-py3"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Initial implementation of base-20 in Python3.
Finalize Python KB20 reference: UTF-8 text mode, strict parsing, and full docs
Summary
This PR brings the Python reference implementation to parity with the C90/C++20 versions and makes it a
solid teaching resource. Text mode now emits/accepts UTF-8 for Unicode digit alphabets (e.g. Kaktovik),
parsing is strict and well-documented, and helpers are fully annotated.
What/Why
Changes
--alphabet: require 20 distinct Unicode scalars.ascii_to_digits_*_strictraise on invalid inputs.bigint_to_base20_digits()guards negative input.write_bigint_to_bytes_be()rejects out-of-range values (no truncation)._besuffix on helpers whose contract is big-endian.Compatibility
'-'for text,0xFFfor binary-digits), same block rules (5 -> 10 digits padded; tail minimal).Tests / Verification
Notes for reviewers
_besuffix is intentional to make byte order explicit in reusable helpers.WIP: Python3 implementationto Python3 implementation