New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@ssts/id

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

@ssts/id

Create unique random string IDs

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Create unique random string IDs

One straight forward function that returns a random ID 😍

Install

npm i @ssts/id

Import

import seniorID from "@ssts/id";

Use

const randomId: string = seniorID();

Examples

import seniorID from "@ssts/id";

console.log(seniorID());                           // 'F5vvaP9D-4e5q-CTow-eUsx-P91RH0pph5Gy'
console.log(seniorID([8]));                        // 'ZILHou6J'
console.log(seniorID([8], "love"));                // 'lllloove'
console.log(seniorID([8], "love"));                // 'velvovvo'
console.log(seniorID([8], "love"));                // 'veoelole'
console.log(seniorID([4], "love"));                // 'lvel'
console.log(seniorID([8, 4]));                     // 'ChOUDIc-4fEf'
console.log(seniorID([8, 4, 4]));                  // 'FHF842Qz-YwMf-clAz'
console.log(seniorID([8, 4, 2]));                  // 'VidKqZr7-IEyN-Fp'
console.log(seniorID([8, 4, 2, 1]));               // 'EUWiP1Fv-eBWp-aw-t'
console.log(seniorID([8, 4, 4, 4, 12]));           // 'CULsKi5d-tP6u-ghe1-noGU-uemm0sxexuhY'
console.log(seniorID([8, 4, 4, 4, 12], "abc123")); // '21ac2b3c-b3a3-3ab3-cccb-13a313aaa1a2'

Arguments

Returns a string

OrderParameterTypeDefault
1lengthArraynumber[][8, 4, 4, 4, 12]
2charactersstring"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"





Made With Chocolate By Senior Sedo 😎

Be Chocolateful 💙😍

ssts stands for senior-sedo-typescript 💙

So instead of @senior-sedo-typescript/rand-id

@ssts/id for simplicity sake 😍






Keywords

FAQs

Package last updated on 02 Dec 2024

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