New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details โ†’
Socket
Book a DemoSign in
Socket

emoid

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

emoid

Create ๐Ÿ˜Ž Emoji IDs instead of uuids because they are more ๐Ÿง‘๐Ÿป friendly

latest
Source
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

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

Keywords

emoji

FAQs

Package last updated on 22 Jul 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts