RubyFlow The Ruby and Rails community linklog

×

The Ruby and Rails community linklog

Made a library? Written a blog post? Found a useful tutorial? Share it with the Ruby community here or just enjoy what everyone else has found!

BasedUUID: URL-friendly UUIDs for Rails models

I made a gem for encoding UUIDs into a URL-friendly, prefixed, base32 format. The rationale behind it is to provide a more manageable, “double-clickable” UUID format and allow for easy lookup (for any model, based on registered prefixes). Inspired by StripeIDs and ulid.

The result is a 26-character, base32-encoded, lowercase string (with an optional prefix):

user_4yoiald3wfbvpeu2sbsk7cssdi

https://github.com/pch/based_uuid

Comments

How comes your example has an “o” in it but “o” isn’t in the base32 alphabet in the code? :-)

Post a comment

You can use basic HTML markup (e.g. <a>) or Markdown.

As you are not logged in, you will be
directed via GitHub to signup or sign in