Socket
Socket
Sign inDemoInstall

otter-uid

Package Overview
Dependencies
0
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    otter-uid

Generates random "unique" identifiers.


Version published
Weekly downloads
0
Maintainers
1
Created
Weekly downloads
 

Readme

Source

Used for generating random "unique" identifiers using the character space of [A-Za-z0-9]. This gives a total unique space of 62^n where n is the length of the identifier.

Example Usage
const uid = require('otter-uid');

// Generate a single UID of the default length (5).
var uid5 = uid();

// Generate a single UID of a set length (7).
var uid7 = uid(7);
var uid7 = uid({ length: 7 });

// Generate a list of 100 UIDs of default length (5). Duplicates are
// not allowed.
var uid100_5 = uid({ count: 100 });

// Generate a list of 100 UIDs of length 7. Duplicates are allowed.
var uid100_7 = uid(7, { count: 100, allowDuplicates: true });
var uid100_7 = uid({ length: 7, count: 100, allowDuplicates: true });

Github

Keywords

FAQs

Last updated on 10 Dec 2016

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc