npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

breezeid

v1.2.1

Published

Easily generate unique, human-first IDs

Downloads

35

Readme

🍃 Breeze ID

Easily generate unique, human-first IDs

GitHub Repo stars npm

Breeze ID is a library that generates unique IDs of any length meant to be easily communicated via speech, that contain no profanities and consist of unambigous characters that can be read easily. Breeze ID's goal is to eliminate human error and still be cryptographically secure.

Breeze ID is best used wherever your IDs:

  • are exposed to end users (for example: public user IDs, error codes... Remember: no profanities!)
  • need to be easily communicated via speech
  • need to be URL safe
  • need to be unique (you can increase the length to improve uniqueness)

But Breeze ID will perform great in any other context too. These are just its strong parts.

Install

npm i breezeid

Use

const { breezeid } = require('breezeid') // or { BreezeID }

// Get ID of default (16) length
breezeid() // => 9NU6-XQLZ-BDIH-6HKE

// Specify custom length (excluding hyphens):
breezeid(8) // => Q228-VQUR

Breeze ID is

For humans

Breeze ID uses an alphabet carefully designed to be easily read and said.

Here's an example ID: WQYW-3AWT-X4R2-97KC. (Notice the uppercasing. It's intentional as I find them easier to read and the alphabet was designed with them in mind, but lowercasing the IDs surely makes them look better. Go with whatever you want.)

Breeze ID automatically inserts hyphens every four characters for easier reading.

The characters used are unambigous, meaning they can't be confused between each other. For example, 1 could be confused with I, so 1 is absent from the alphabet.

Breeze ID also blocks profanities by default. It uses an efficient algorithm that at first tries to regenerate the detected profane part of an ID (this succeeds almost every time). However, if it generates another profanity, the profane part is just reversed to omit unecessary calls to the OS. This makes Breeze ID completely profanity free.

Unique

Collisions

You would need to generate 156 billion IDs with default settings to reach 1% probability of collision.If you were to generate 1000 IDs every hour non-stop, it would take you ~18 thousand years.

But these numbers can still be improved - if you generate Breeze IDs of 24 length, reaching 1% probability of collision while generating 1000 ids per second would take ~5 million years. If you were to care about 50% probability (which is common when testing random ID generating libraries), this would be ~43 million years.

Entropy

Breeze ID uses crypto.randomBytes internally, meaning you get cryptographically secure entropy from your OS. The characters from the alphabet are then picked by the modulo operator. There's no modulo bias introduced as the carefully picked alphabet consists of exactly 32 characters.

URL safe

Breeze ID is completely safe to use in URLs. No need for any encoding, it's built in.

Performant

Breeze ID doesn't make unnecessary calls for entropy to your OS every time you generate an ID. Instead, it asks for entropy in big batches only when it needs to.