Skip to content

Latest commit

 

History

History
16 lines (12 loc) · 754 Bytes

README.md

File metadata and controls

16 lines (12 loc) · 754 Bytes

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"