Skip to content
This repository has been archived by the owner on Aug 24, 2021. It is now read-only.

WIP: fix: use strict encoding for base2 #26

Conversation

fahrradflucht
Copy link

@fahrradflucht fahrradflucht commented Apr 8, 2018

Add a custom base2 implementation that doesn't truncate leading zeros.

This is progress on #24 though base8, base10 and base16 should 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.

Don't truncate leading zeros for base2 encodings since it leads to ambiguity.
@fahrradflucht fahrradflucht changed the title fix: use strict encoding for base2 WIP: fix: use strict encoding for base2 Apr 8, 2018
@daviddias daviddias added the status/ready Ready to be worked label Aug 25, 2018
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
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status/ready Ready to be worked
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants