
Security News
AI Agent Lands PRs in Major OSS Projects, Targets Maintainers via Cold Outreach
An AI agent is merging PRs into major OSS projects and cold-emailing maintainers to drum up more work.
A lightweight JavaScript library for generating random alphanumeric strings and characters
A lightweight JavaScript library for generating random alphanumeric strings and characters. Perfect for creating IDs, tokens, passwords, or any random string needs.
npm install alpha-deca
import { randomString, randomChar, getAlphanumericChars } from 'alpha-deca';
// Generate a random 8-character string
const id = randomString(8);
console.log(id); // e.g., "A7bK9mN2"
// Generate a single random character
const char = randomChar();
console.log(char); // e.g., "X", "5", "z"
// Get all available alphanumeric characters
const chars = getAlphanumericChars();
console.log(chars); // ['0', '1', '2', ..., '9', 'A', 'B', ..., 'Z', 'a', 'b', ..., 'z']
getAlphanumericChars()Returns an array containing all alphanumeric characters (0-9, A-Z, a-z).
Returns: string[] - Array of alphanumeric characters
import { getAlphanumericChars } from 'alpha-deca';
const chars = getAlphanumericChars();
// Returns: ['0', '1', '2', ..., '9', 'A', 'B', ..., 'Z', 'a', 'b', ..., 'z']
randomChar()Generates a single random alphanumeric character.
Returns: string - A single random character (0-9, A-Z, a-z)
import { randomChar } from 'alpha-deca';
const char = randomChar();
// Returns: "A", "5", "z", etc.
randomString(length)Generates a random string of specified length using alphanumeric characters.
Parameters:
length (number) - The length of the string to generateReturns: string - A random string of the specified length
import { randomString } from 'alpha-deca';
// Generate different length strings
const shortId = randomString(4); // e.g., "K9mN"
const mediumId = randomString(8); // e.g., "A7bK9mN2"
const longId = randomString(16); // e.g., "X5kL8mN2pQ9rS3tU"
randomNumber(length)Generates a random string of specified length using alphanumeric characters.
Note: Currently identical to
randomString(). May be enhanced in future versions to generate numeric-only strings.
Parameters:
length (number) - The length of the string to generateReturns: string - A random string of the specified length
import { randomNumber } from 'alpha-deca';
const num = randomNumber(6);
// Returns: "K9mN2p"
import { randomString } from 'alpha-deca';
const userId = randomString(12);
const sessionId = randomString(16);
const orderId = randomString(8);
import { randomString } from 'alpha-deca';
const tempPassword = randomString(10);
console.log(`Your temporary password is: ${tempPassword}`);
import { randomString } from 'alpha-deca';
const apiKey = randomString(32);
console.log(`API Key: ${apiKey}`);
import { randomString } from 'alpha-deca';
const resetToken = randomString(24);
const verificationCode = randomString(6);
This package works in modern browsers that support ES6 modules:
<script type="module">
import { randomString } from 'https://unpkg.com/alpha-deca@1.0.0/app.js';
const id = randomString(8);
console.log(id);
</script>
git clone https://github.com/decagondev/alpha-deca.git
cd alpha-deca
npm install
npm test # Run tests
npm run lint # Lint code
npm run format # Format code
git checkout -b feature/amazing-feature)git commit -m 'Add some amazing feature')git push origin feature/amazing-feature)This project is licensed under the MIT License - see the LICENSE file for details.
getAlphanumericChars() functionrandomChar() functionrandomString() functionrandomNumber() functionIf you encounter any issues or have questions, please open an issue on GitHub.
Made with ❤️ for the JavaScript community
FAQs
A lightweight JavaScript library for generating random alphanumeric strings and characters
The npm package alpha-deca receives a total of 1 weekly downloads. As such, alpha-deca popularity was classified as not popular.
We found that alpha-deca 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
An AI agent is merging PRs into major OSS projects and cold-emailing maintainers to drum up more work.

Research
/Security News
Chrome extension CL Suite by @CLMasters neutralizes 2FA for Facebook and Meta Business accounts while exfiltrating Business Manager contact and analytics data.

Security News
After Matplotlib rejected an AI-written PR, the agent fired back with a blog post, igniting debate over AI contributions and maintainer burden.