
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
Generate secure and unique short IDs in JavaScript, tested for reliability and compatibility with browsers
SSID Generator is a Node.js module that provides a secure and efficient way to generate short IDs, suitable for various use cases such as unique identifiers in databases, session IDs, URL shorteners, etc.

You can install the Secure Short ID Generator module via npm:
npm install ssid
const { ssid } = require("ssid");
const shortId = ssid();
console.log("Short ID : ", shortId);
// Short ID : h7g6fb-n
const { ssid, ssidWithAffixes, ssidWithTimestamp } = require("ssid");
const customAlphabet = "abcdefghijklmnopqrstuvwxyz1234567890";
const shortId = ssid(8, customAlphabet);
console.log("Short ID : ", shortId);
// Short ID : 9gHs8b1m
const shortId = ssidWithAffixes(11, "ssid-");
console.log("Short ID : ", shortId);
// Short ID : ssid-b7shdn
const customAlphabet = "abcdefghijklmnopqrstuvwxyz1234567890";
const shortId = ssidWithAffixes(8, "2025", "", customAlphabet);
console.log("Short ID : ", shortId);
// Short ID : 2025dh2n
const shortId = ssidWithTimestamp(11);
console.log("Short ID : ", shortId);
// Short ID : 1738479600000-bsh89mH2VAO
// Generate a short ID with a default length of 8 characters, including a timestamp. The total length will be 14 characters for the timestamp plus 8 characters for the short ID, resulting in 22 characters in total.
const customAlphabet = "abcdefghijklmnopqrstuvwxyz1234567890";
const shortId = ssidWithTimestamp(8, customAlphabet);
console.log("Short ID : ", shortId);
// Short ID : 1738490400000-8NbSm10H
ssid(length = DEFAULT_LENGTH(8), customAlphabet = DEFAULT_ALPHABET(a-zA-Z0-9_-))| Parameter | Type | Default | Description |
|---|---|---|---|
length | Number | DEFAULT_LENGTH | The length of the generated ID. Minimum length is 4. |
customAlphabet | String | DEFAULT_ALPHABET | A custom set of characters to use for generating the ID. |
ssidWithAffixes(length = DEFAULT_LENGTH(8), prefix, suffix, customAlphabet = DEFAULT_ALPHABET(a-zA-Z0-9_-))| Parameter | Type | Default | Description |
|---|---|---|---|
length | Number | DEFAULT_LENGTH | The length of the generated ID (prefix+suffix). Minimum length is 4. |
prefix | String | A string to prepend to the generated ID. Either prefix or suffix must be provided. | |
suffix | String | A string to append to the generated ID. Either prefix or suffix must be provided. | |
customAlphabet | String | DEFAULT_ALPHABET | A custom set of characters to use for generating the ID. |
ssidWithTimestamp(length = DEFAULT_LENGTH(8), customAlphabet = DEFAULT_ALPHABET(a-zA-Z0-9_-))| Parameter | Type | Default | Description |
|---|---|---|---|
length | Number | DEFAULT_LENGTH | The length of the short ID other than timestamp. Minimum length is 4. |
customAlphabet | String | DEFAULT_ALPHABET | A custom set of characters to use for generating the ID. |
This project is licensed under the MIT License.
FAQs
Generate secure and unique short IDs in JavaScript, tested for reliability and compatibility with browsers
We found that ssid demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.