https://github.com/alexmayol/emojid
Generate IDs and UUIDs the right way ๐๐
https://github.com/alexmayol/emojid
emoji generator hacktoberfest uuid
Last synced: about 1 year ago
JSON representation
Generate IDs and UUIDs the right way ๐๐
- Host: GitHub
- URL: https://github.com/alexmayol/emojid
- Owner: AlexMayol
- Created: 2022-03-20T01:13:29.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2025-04-28T23:55:35.000Z (about 1 year ago)
- Last Synced: 2025-05-04T15:02:06.507Z (about 1 year ago)
- Topics: emoji, generator, hacktoberfest, uuid
- Language: TypeScript
- Homepage:
- Size: 2.45 MB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Emojid
Generate IDs and UUIDs with emojis.
`npm i @midnight-city/emojid`
`yarn add @midnight-city/emojid`
Give your users a nice time looking at their funny URL at the cost of bloating your database with hell itself.
Some libraries shouldn't exist. This is one of them.
```js
import { emojid, uuid } from "@midnight-city/emojid";
const id = emojid(6);
//"๐ฒ๐ฆ๐๐ฎ๐๐ฉ"
const uuid = uuid();
// "๐น๐ด๐ง๐ฆฅ-๐๐-๐ช๐-๐๐ง๐ฆ๐๐งป๐๐ด๐ฑ"
```
# API
You can also use the public API if you don't feel like installing yet another dependency:
[https://emojid-generator.vercel.app/api/uuid](https://emojid-generator.vercel.app/api/uuid)
[https://emojid-generator.vercel.app/api/id](https://emojid-generator.vercel.app/api/id)
[https://emojid-generator.vercel.app/api/id/:number](https://emojid-generator.vercel.app/api/id/:number)
## Caveats and gotchas
It turns out the lenght of most emojis is 2, but some of them have a lenght of 1 and even length of 5. [Check it out using this list](https://www.freecodecamp.org/news/all-emojis-emoji-list-for-copy-and-paste/)
`'โก'.length == 1`
`'๐'.length == 2`
`'๐ฉโ๐ฆฐ'.length == 5`
`'๐ฉโ๐ฉโ๐ฉโ๐งโ๐ง'.length == 14`
๐ค๐ค