This repository was archived by the owner on Aug 24, 2021. It is now read-only.
WIP: fix: use strict encoding for base2#26
Closed
fahrradflucht wants to merge 1 commit intomultiformats:masterfrom
Closed
WIP: fix: use strict encoding for base2#26fahrradflucht wants to merge 1 commit intomultiformats:masterfrom
fahrradflucht wants to merge 1 commit intomultiformats:masterfrom
Conversation
Don't truncate leading zeros for base2 encodings since it leads to ambiguity.
hugomrdias
added a commit
that referenced
this pull request
Jun 9, 2020
- adds support for all the encodings in https://github.com/multiformats/multibase/blob/master/multibase.csv - better errors showing the invalid chars and inputs - `names` and `codes` exports the full object that maps names/codes to base instances - you can use these to get the unprefixed base encoder/decoder - two new methods exported, `encoding` and `encodingFromData` - you can use these to get the unprefixed base encoder/decoder - adds all the spec tests https://github.com/multiformats/multibase/tree/master/tests - its also faster check benchmarks below This module now only uses 2 base encoding implementations, 1 generalised rfc4648 and 1 generalised btc like. closes #49 closes #38 closes #46 closes #53 closes #26 BREAKING CHANGE: `names` and `codes` export the full object that maps names/codes to base instances instead of just the keys
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Add a custom base2 implementation that doesn't truncate leading zeros.
This is progress on #24 though
base8,base10andbase16should be broken as well.--
Edit:
Marking this as WIP since thinking about how to implement the remaining bases I think it doesn't make sense to have a special solution for base2.