emoid

1.0.1Β β€’Β PublicΒ β€’Β Published

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%)

/emoid/

    Package Sidebar

    Install

    npm i emoid

    Weekly Downloads

    0

    Version

    1.0.1

    License

    MIT

    Unpacked Size

    4.07 kB

    Total Files

    7

    Last publish

    Collaborators

    • greencoder001