cross-uid

1.2.0 • Public • Published

Cross Unique Id


Build Status    Coverage Status    NPM version    License    Code Size    Code of Conduct

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!__

License


MIT © Imed Jaberi

Package Sidebar

Install

npm i cross-uid

Weekly Downloads

1

Version

1.2.0

License

MIT

Unpacked Size

5.07 kB

Total Files

4

Last publish

Collaborators

  • 3imed-jaberi