Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

uid

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

uid

A tiny (130B to 205B) and fast utility to randomize unique IDs of fixed length

  • 2.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3.1M
increased by6.76%
Maintainers
1
Weekly downloads
 
Created

What is uid?

The uid npm package is a simple utility for generating unique IDs of variable length. It is commonly used when a short, unique identifier is needed, such as for database keys, component identifiers in a UI, or any other case where a string ID is required.

What are uid's main functionalities?

Generating a UID of default length (11 characters)

This feature generates a unique identifier string with a default length of 11 characters. The generated ID is a random string that can be used where a unique identifier is needed.

"use strict";
const uid = require('uid');
const id = uid();
console.log(id);

Generating a UID of a specific length

This feature allows the generation of a unique identifier string of a specific length. The length is passed as an argument to the uid function, allowing for IDs of varying sizes to be created according to the needs of the application.

"use strict";
const uid = require('uid');
const length = 16;
const id = uid(length);
console.log(id);

Other packages similar to uid

Keywords

FAQs

Package last updated on 31 Mar 2023

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc