Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add in a sortable base64 encoding from multibase #9

Open
CMCDragonkai opened this issue Oct 22, 2021 · 1 comment
Open

Add in a sortable base64 encoding from multibase #9

CMCDragonkai opened this issue Oct 22, 2021 · 1 comment
Labels
enhancement New feature or request r&d:polykey:core activity 3 Peer to Peer Federated Hierarchy

Comments

@CMCDragonkai
Copy link
Member

CMCDragonkai commented Oct 22, 2021

Is your feature request related to a problem? Please describe.

From this issue multiformats/js-multiformats#124, it is clear that the highest sortable encoding right now in multibase is base32hex.

When using this for IdSortable, from 16 bytes, we get a encoded string length of 27 (v00qnlvl084e15mk9inn1en2gno). A higher base like base64 would be nicer as it could give us 23 characters instead.

There are 2 implementations of sortable base64.

Obviously what we would like is something that looks like base58btc as it is intended that such ids would be presented to the end user, and but get a guarantee that it is sortable.

Describe the solution you'd like

A human-centered readable encoding for IdSortable that is base64 (it has to be double of base32), that is sortable.

There's no existing standard for this except uuencode according to: https://stackoverflow.com/questions/53301280/does-base64-encoding-preserve-alphabetical-ordering#comment101660912_55011262

Describe alternatives you've considered

  • base32hex is the only viable one atm

Additional context

Expect this to be used by notifications, sigchain and all the places we use IdSortable.

@CMCDragonkai CMCDragonkai added the enhancement New feature or request label Oct 22, 2021
@CMCDragonkai
Copy link
Member Author

@tegefaulkes this means base32hex needs to be used everywhere IdSortable is used atm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request r&d:polykey:core activity 3 Peer to Peer Federated Hierarchy
Development

No branches or pull requests

1 participant