fixed-id

1.0.0 • Public • Published

Fixed ID

This is a implementation of NanoID with fixed options. These different options are:

  • Only alphanumeric to make it ultra-safe in URLs/filenames/etc. No underscores _ nor dashes -.
  • 24 characters instead of 21 to make it even safer.
npm install fixed-id
import fixedId from "fixed-id";
// const fixedId = require("fixed-id");

console.log(fixedId());
// sjBPT3hhUdCpP7rCDS4qu03Q
// ilWz42q9iDp7b3ZlfoYg58e7
// DBEDAytRL2M9uCGbxFfKzN4T
// dFtijnQY8KhPphCOZ9aFWntD
// ...

According to the calculator, with this implementation:

~14 million years needed, in order to have a 1% probability of at least one collision when generating 1 million of IDs per second.

Package Sidebar

Install

npm i fixed-id

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

2.43 kB

Total Files

4

Last publish

Collaborators

  • franciscop