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 base64 or 62 #47

Closed
revington opened this issue Aug 31, 2012 · 4 comments
Closed

Support base64 or 62 #47

revington opened this issue Aug 31, 2012 · 4 comments

Comments

@revington
Copy link

It would be great to have uuid's in base62/64 format for docs, urls, or for couchdb _id

@broofa
Copy link
Member

broofa commented Aug 31, 2012

I'd rather not have node-uuid be in the business of providing non-standard formats. There are just too many ambiguities around how it should be implemented (e.g. http://en.wikipedia.org/wiki/Base64#Variants_summary_table). If you want to base64-encode an RFC uuid, you can do it like thus:

> new Buffer(require('./uuid').v1(null, [])).toString('base64')
'/SezcPN7EeGWAtmjqs3xzQ=='

@broofa broofa closed this as completed Aug 31, 2012
@dmarcelino
Copy link

If anyone is interested in generating base62 UUIDs, I've created uuid-base62 for that purpose. It also exposes node-uuid for convenience.

@G7495x
Copy link

G7495x commented Nov 6, 2021

It is 2021. I guess it may be time to reconsider this once again...? I see two major formats - Base64 and Base64URL. Please consider... I have been using helper functions for too long already...

Advantages:

  • Smaller string sizes
  • Lower string comparison overhead

@ctavan
Copy link
Member

ctavan commented Nov 6, 2021

Please see #47 (comment)

The goal of this library is to implement the RFC4122 standard, nothing more, nothing less.

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

No branches or pull requests

5 participants