-
Notifications
You must be signed in to change notification settings - Fork 114
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
Adding the ability to encode/decode to/from Base64 and Base32 #81
Comments
What's the use case? I personally never seen it encoded anything but binary or hex-string. |
One use case is when I use UUIDs in URLs. Base64 produces shorter string representation. in case I need shorter case-insensitive UUID string I use Base32. |
Equivalent functionality is https://www.npmjs.com/package/short-uuid |
Personally, I'd argue that this would be an unnecessary extension, since it would essentially be 1-line pass-through calls to |
I have a wrapper which uses base58, a handy middle ground which is used widely https://github.com/wolfeidau/shortuuid, as you say it is a pretty simple wrapper around existing UUID libraries. Keen to migrate this to this library so i can try out v6 UUIDs. |
Doing a little research on the topic, I think we should use base58 as is done with @wolfeidau's package.
https://en.wikipedia.org/wiki/Binary-to-text_encoding#Base58 |
I think |
I agree on the clunkiness and the potential verbosity of maintaining a bunch of permutations of different base values. How would you feel about a pair of functions that worked like
|
I don't really like |
I've found myself encoding the UUID to Base64 and Base32 string in multiple projects I worked on.
Do you think it's a good idea if we add this encoding and decoding to this library or that's out of its scope?
Thanks
The text was updated successfully, but these errors were encountered: