1.0.0 • Published 3 years ago

fixed-id v1.0.0

Weekly downloads
5
License
MIT
Repository
-
Last release
3 years ago

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.