
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
random-web-token
Advanced tools
Generating tokens with (a-z, a-Z, a-Z + 0-9 ...etc) or your own characters easily without external dependencies
npm install random-web-token
Generating a token using genSync() or genAsync()
const token = require("random-web-token");
console.log(token.genSync("extra", 50)) // -> sHF3p8zZCTdAmJ0cyS60NK9RRPXi6NQ42zdUbigMBZYZY0504H
first parameter is a string
second parameter is a number, the length of token
Token validation using syncValidator() or asyncValidator()
const firstToken = token.genSync("extra", 50);
console.log(token.syncValidator("extra", 50, firstToken)) // true firstToken same type,length
console.log(token.syncValidator("extra", 40, firstToken)) // false firstToken same type, but firstToken length !== 40
console.log(token.syncValidator("normal", 50, firstToken)) // false firstToken same length but not the same type.
const secondToken = token.genSync("extra", 50) + "+!/"; // returns 50 length token + 3 extra character
console.log(token.syncValidator("extra", 53, secondToken, "+!/")) // true same type/length and +3 allowed characters "+!/"
console.log(token.syncValidator("extra", 53, secondToken, "")) // false same type/length but "+!/" characters not allowed
fourth parameter is optional
use withMyOwnCharacters() method
await token.withMyOwnCharacters("abc123", 10) // -> a2b1cc23ab
FAQs
Generate customizable random strings (tokens) using secure charsets with validation – zero dependencies.
The npm package random-web-token receives a total of 28 weekly downloads. As such, random-web-token popularity was classified as not popular.
We found that random-web-token demonstrated a healthy version release cadence and project activity because the last version was released less than 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
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.