https://github.com/acryps/micro-uuid
Converts UUIDs into a shortened URL-encodeable form
https://github.com/acryps/micro-uuid
Last synced: about 1 month ago
JSON representation
Converts UUIDs into a shortened URL-encodeable form
- Host: GitHub
- URL: https://github.com/acryps/micro-uuid
- Owner: acryps
- Created: 2024-03-01T14:12:25.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-03-01T14:16:18.000Z (over 2 years ago)
- Last Synced: 2025-02-25T21:32:53.063Z (over 1 year ago)
- Language: JavaScript
- Size: 1000 Bytes
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# MicroUUID
Converts UUIDs into a shortened URL-encodeable form.
Now you can use shorter URLs!
```
https://example.com/offer/7f6e5313-2103-431c-b299-769f7db25008 → https://example.com/offer/IhfFAYArMGYYLVcIIWEMat
```
```
import { shorten, expand } from '@acryps/micro-uuid';
// create a cool short link to an offer
const linkButton =
{offer.name}
;
// get the offer by UUID from the link
const offer = await offerService.find(expand(parameters.id));
```
The encoding uses a base64-esque form (using 63 = - and 64 = _). The mapping has been picked randomly.