https://github.com/nashaddams/uuidkey
Encode UUIDs to readable keys with Crockford base32
https://github.com/nashaddams/uuidkey
api-keys crockford crockford-base32 uuid
Last synced: 2 months ago
JSON representation
Encode UUIDs to readable keys with Crockford base32
- Host: GitHub
- URL: https://github.com/nashaddams/uuidkey
- Owner: nashaddams
- License: mit
- Created: 2025-01-11T17:29:17.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2025-01-12T11:13:20.000Z (5 months ago)
- Last Synced: 2025-02-05T23:44:09.776Z (4 months ago)
- Topics: api-keys, crockford, crockford-base32, uuid
- Language: TypeScript
- Homepage: https://jsr.io/@nashaddams/uuidkey
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# uuidkey
[](https://jsr.io/@nashaddams/uuidkey)
[](https://jsr.io/@nashaddams/uuidkey)
[](https://github.com/nashaddams/uuidkey/actions)Encode UUIDs to readable keys with
[Crockford base32](https://www.crockford.com/base32.html), inspired by
[`agentstation/uuidkey`](https://github.com/agentstation/uuidkey)'s approach for
[making beautiful API keys](https://docs.agentstation.ai/blog/beautiful-api-keys/).## Usage
```ts
import { decode, encode, generate, validate } from "@nashaddams/uuidkey";encode("01945655-0794-7259-800b-614c6ea29659"); // -> 06A5CN8-0YA74P8-G05P2K0-DTH9CP8
decode("06A5CN8-0YA74P8-G05P2K0-DTH9CP8"); // -> 01945655-0794-7259-800b-614c6ea29659
validate("06A5CN8-0YA74P8-G05P2K0-DTH9CP8"); // -> true
generate(); // -> { key: "06A5CQ8-SGRQZ7G-KHQWGF0-PM9JZ90", uuid: "0194565d-cc31-7f9e-9c6f-c83cb5132fa4" }
```See [the docs](https://jsr.io/@nashaddams/uuidkey/doc) for further details.
Alternatively, `uuidkey` can also be run via CLI:
```sh
deno run -R=. jsr:@nashaddams/uuidkey [--help]
```