An open API service indexing awesome lists of open source software.

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

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.