xuid.org
Frequently Asked Questions
What is a XUID?
A XUID is a URL-safe compressed UUID
How much shorter are XUIDs?
A UUID v4 is generally 36 characters. A XUID is 22 characters.
Are XUIDs just as unique as UUIDs?
A XUID is simply a compressed UUID. It holds just as much uniqueness as a full UUID, and can even be decoded back into it's original UUID.
How do I convert a UUID into a XUID?
- Convert a UUID string into a 128 bit number
- Base64 encode this number
- Strip any trailing `=` signs on the right of the resulting base64 string
- Replace all `+` characters with `-`
- Replace all `/` characters with `_`
How do I convert a XUID into a UUID?
- Replace all `_` characters with `/`
- Replace all `-` characters with `+`
- Base64 decode this string into a number
- Convert this number into a hex string
- (optional) add dashes in appropriate places
Are there any programming libraries available?
Here's a list. Please send us a message if you know of any new libraries:
- http://github.com/linkorb/xuid PHP Library
- https://github.com/taskcluster/slugid Javascript