cross-uid
v1.2.0
Published
Generate a randomize identifer with fixed length ⚡.
Downloads
4
Maintainers
Readme
Cross Unique Id
Generate a randomize identifer with fixed length ⚡.
- 🔥 Blaze, Simple and lightweight.
- ✨ Polyfill Unique Id (Browser + Node.js).
- ⚖️ Tiny Size.
Installation
# npm ..
$ npm install cross-uid
# yarn ..
$ yarn add cross-uid
Usage
This is a practical example of how to use.
const uid = require("cross-uid");
// you can pass a optional length arg to this func.
// the default value of length is 12.
// const myUniqueId = uid();
const myUniqueId = uid(15);
// Result:
// console.log(myUniqueId);
// Treminal
// $your_pc_name_with_your_directory
// 'xxxxxxxxxx'
__Important: Your risk of collisions decreases with longer strings!__