Skip to content

Create 😎 Emoji IDs instead of uuids because they are more πŸ§‘πŸ» friendly

License

Notifications You must be signed in to change notification settings

cabraviva/emoji-id

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

emoid

Create 😎 Emoji IDs instead of uuids because they are more πŸ§‘πŸ» friendly

Usage

const id = require('emoid')

// πŸ™‚ is a placeholder for one of 1493 emojis
// The default length is 3
id() // -> πŸ™‚πŸ™‚πŸ™‚


id(1) // -> πŸ™‚
id(2) // -> πŸ™‚πŸ™‚
id(3) // -> πŸ™‚πŸ™‚πŸ™‚
id(5) // -> πŸ™‚πŸ™‚πŸ™‚πŸ™‚πŸ™‚
// ...

Probabilities of a non-unique id

For the default length (3), the probability of a non-unique id is 1/3327970157 If you want to calculate it for a custom length, use the following formula:

const id = require('emoid')
id.calculateProbability(length) // -> Output String

id.calculateProbability(3) // -> Every 3327970157th id is non unique when the length is 3 (thats 3.0048346374038715e-8%)

About

Create 😎 Emoji IDs instead of uuids because they are more πŸ§‘πŸ» friendly

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published