Refactor: refactor base encodings for consistency, correctness, and deduplication#10
Merged
Merged
Conversation
Comprehensive refactoring of all base encoding implementations (Base2, Base8, Base16, Base32, Base45, Base64, Base85, MoneroBase58, DividingCoder, Multibase). - Made Base64 TryEncode/TryDecode allocation-free with two-layer architecture - Added static Internal safe-count methods to Base64, matching other bases - Replaced shr on signed types with TBitOperations.Asr32/Asr64 for cross-platform correctness - Abstracted reverse lookup access into shared TCodingAlphabet.TryLookup - Unified decode success path to System.Copy trim pattern across all bases - Added upfront buffer validation and empty-input guards to all Try* methods - Deduplicated TBits.PartialBigEndianBytesToUInt64 (MoneroBase58 now uses it) - Removed redundant Base16Alphabet.MapCounterparts and Multibase helper - Standardized error messages, exception types, and System-qualified calls - Various minor fixes: comment typos, bounds guards, empty-result guards
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.
Comprehensive refactoring of all base encoding implementations (Base2, Base8, Base16, Base32, Base45, Base64, Base85, MoneroBase58, DividingCoder, Multibase).