Skip to content

Convert a UUID to a shorter, URL-safe base64 string and back.

Notifications You must be signed in to change notification settings

ianobermiller/uuid-url

Repository files navigation

uuid-url

npm npm bundle size npm type definitions NPM

Tiny (< 1kB) library to convert a UUID to a shorter (22 character), URL-safe base64 string and back. Uses uuid for parsing and stringifying UUIDs. Tree-shakeable ESM or CommonJS. Written in TypeScript.

import { urlToUuid, uuidToUrl } from "uuid-url";

uuidToUrl("376a4cca-9431-44f0-bc04-054faffba9b1"); // "N2pMypQxRPC8BAVPr_upsQ"
urlToUuid("N2pMypQxRPC8BAVPr_upsQ"); // "376a4cca-9431-44f0-bc04-054faffba9b1"

About

Convert a UUID to a shorter, URL-safe base64 string and back.

Resources

Stars

Watchers

Forks

Packages

No packages published