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

support crockford base32, Base-X base58, base62 #33

Open
5 tasks
coolaj86 opened this issue Mar 7, 2023 · 2 comments
Open
5 tasks

support crockford base32, Base-X base58, base62 #33

coolaj86 opened this issue Mar 7, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@coolaj86
Copy link

coolaj86 commented Mar 7, 2023

The use case for Base32 is to provide something that's easier to write down and re-enter correctly - otherwise you'd always use base64. Base-N Base32 does not accomplish this. Crockford Base32 does (and another one I'm forgetting at the moment).

For this reason, the Base-N version of Base32 is rarely used. Almost always (survey other base32 libraries) it's Crockford Base32, which ensures that there are no ambiguous combinations - such as 0 and O, etc.

A few other bases that are popular in certain niches:

  • Crockford Base32
  • Base-X Base58 is used for cryptocurrency addresses and follows the same principles as Crockford Base32 in regards to character selection, but is also generic to arbitrary bit-widths (due to Base-X implementation)
    • Base58Check (the standard for how this is used in practice: Base58(Magic Bytes (Version) + Data + Checksum)
  • Base62 is used for prefixed & checksummed access tokens (e.g. GitHub, npm, Digital Ocean, etc)
    • Base62Check an informal name for actual way tokens are generated: Prefix + Base62(Entropy + Checksum)
@abhimanyu003 abhimanyu003 added the enhancement New feature or request label Mar 8, 2023
@abhimanyu003
Copy link
Owner

Hello @coolaj86 thanks so much for you suggestion.

Sure i'm having a look at this, base62 looks like like a quick feature to add with dictionary

0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz

Can you please provide little bit of details around entropy and entropy length

@coolaj86
Copy link
Author

coolaj86 commented Mar 15, 2023

Re: base62: Can you please provide little bit of details around entropy and entropy length

By entropy I just mean "random bytes". Base62 isn't used in practice for data, just for tokens with a checksum, as described by:

This may be the most concise and descriptive section of it all:
https://github.com/therootcompany/base62-token.js#github-token-breakdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants