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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@v57/id

v1.0.4

Published

Generates random id in base58 format

Downloads

30

Readme

Base58 ID Generator: Generate Unique IDs in Node.js

The Base58 Random ID Generator is a powerful Node.js package that enables developers to effortlessly generate unique and secure identifiers in the Base58 format. By leveraging the simplicity and efficiency of Base58 encoding, this package provides a reliable method for generating random IDs that are ideal for various use cases, including database keys, short URLs, cryptographic nonces, and more.

With this package, you can quickly generate IDs that are resistant to human error and ensure compatibility across different systems. Base58 encoding eliminates ambiguous characters, such as 0 (zero), O (uppercase o), I (uppercase i), and l (lowercase L), which can cause confusion in certain contexts. This ensures that the generated IDs are easier to read, write, and communicate accurately.

The Base58 Random ID Generator offers flexibility and customizability, allowing you to specify the desired length of the generated IDs. Additionally, it provides a cryptographically secure source of randomness, ensuring that the generated IDs are highly unpredictable and resistant to brute-force attacks.

Key Features:

Generate unique identifiers in Base58 format Suitable for diverse use cases Ensures compatibility and readability Customizable ID length Utilizes secure source of randomness Simple integration into Node.js applications Simplify ID generation in your Node.js applications with the Base58 ID Generator. Create unique and secure IDs effortlessly while ensuring compatibility and readability.

Comparing to others

🗿 77342993 snowflake - unique by design, exposed to scrapping

🗿 iF46TNQVP1a base58 64bit - unlikely to collide, but still exposed

🗿 8g3GgFVUYrQrfepEQrD63v base58 128bit - shortest, no chance of collision

🤡 45HHx2+f8Y8pisEqszsogA== base64 128bit - ugly in urls

🤡 72868a6f0c1b13ebe96fdd39f64c95c4 hex 128bit - lots of unused characters

🤡 6310304c-450b-4670-bbb0-eb8e80e7fd46 uuid 128bit - fastest to generate, but consumes lots of space

Installation

npm install --save @v57/id

Generating id

let { newId } = require('@v57/id')
const id = newId(16) // returns 256 bit random id in base58 format

Generating unique id

Using sets

let { uniqueId } = require('@v57/id')
let ids = new Set()
// will check if id already exists in set
const id = uniqueId(4, id => ids.has(id))

Using MongoDB

let { uniqueId } = require('@v57/id')
// will check if id already exists in collection
const id = uniqueId(4, async id => await mongo.collection('some').findOne({ id }))

Performance

Generating 1 million ids

  • uuid(128bit) 0.051s (fastest)
  • hex(128bit) 1.621s
  • base64(128bit) 1.584s
  • base58(128bit) 1.795s
  • base58(64bit) 1.851s
  • snowflake 0.976s

Use cases

newId(4) // very short id, you can only have 4 billion of them so use it for small lists (less than 100k items is enough to not worry about checking for already used)
newId(8) // short id, consider it as public id
newId(16) // use it for main id cannot be randomly accessed
newId(32) // you can use it to generate secrets, keys and password