New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

ufid

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ufid

URL friendly reasonably unique ids.

latest
Source
npmnpm
Version
2.0.1
Version published
Maintainers
1
Created
Source

NPM version Build Status Dependency Status

ufid

URL friendly reasonably unique ids.

Install

$ npm install --save ufid

Usage

Generate uids with only numbers and letters (both uppercase and lowercase):

import { generator } from 'ufid';

const uid = generator({ size: 10 });

uid();  // 10 characters long
uid();  // another one - also 10 characters long
uid(8); // another one 8 characters long

With custom alfabet:

import { generator } from 'ufid';

const uid = generator({ size: 12, alphabet: 'abc0123A' });

uid();  // 12 characters long, only a-c, 0-3, and A

With custom byte stream:

import { generator } from 'ufid';

const byteStream = {
  next: () => Math.random() * 62
};
const uid = generator({ size: 6, byteStream });

uid();  // 6 characters long using non-secure random

License

MIT © Damian Krzeminski

Keywords

ufid

FAQs

Package last updated on 02 Oct 2025

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