slugid 1.1.2 copy "slugid: ^1.1.2" to clipboard
slugid: ^1.1.2 copied to clipboard

A URL-safe base64 encoding for UUIDv4 stripped of padding. Useful when embedding short random UUIDs in URLs.

Slugid - Compressed UUIDv4 #

A slugid is a URL-safe base64 encoded UUID version 4 stripped of == padding bringing the total size to 22 characters.

Disclaimer: This is not an officially supported Google product.

Examples of slugids:

  • U_sWAEJnR4epXu-TK0FCYA
  • -8prq-8rTGqKl2W9SSfyDQ
  • ti8C-AKGQsq3rDjSuXe94w
  • Fum-zBhASyO50rg3mtQcD

There are two variants of slugids:

  • The Slugid.v4() variant, which is a random UUID v4.
  • The Slugid.nice() variant, which is a random UUID v4 selected such that the slugid encoding doesn't start with -.

The nice variant is nicer to use in commandline utilities, but it comes at a slight cost in entropy. For more details refer to the original implementation in javascript.

See also #

46
likes
160
pub points
83%
popularity

Publisher

verified publishergoogle.dev

A URL-safe base64 encoding for UUIDv4 stripped of padding. Useful when embedding short random UUIDs in URLs.

Homepage
Repository (GitHub)
View/report issues
Contributing

Topics

#uuid

Documentation

API reference

License

Apache-2.0 (license)

Dependencies

convert, meta

More

Packages that depend on slugid