npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@adaikkappan_ramaiah/random-gen

v1.0.1

Published

Random values generator

Readme

@adaikkappan_ramaiah/random-gen

A tiny, dependency‑free utility for generating random hex colors and simple random passwords.

  • randomColor() → returns a hex color like #A1B2C3
  • randomPassword(len = 10) → returns a password of the given length using letters, numbers, and @#$%^&*

Source: index.js

Note: This library uses Math.random() and is not cryptographically secure. Do not use it for secrets, tokens, or other security‑sensitive purposes.

Installation

npm install @adaikkappan_ramaiah/random-gen
# or
yarn add @adaikkappan_ramaiah/random-gen
# or
pnpm add @adaikkappan_ramaiah/random-gen

Usage

ES Modules (Node.js or modern bundlers)

import { randomColor, randomPassword } from '@adaikkappan_ramaiah/random-gen';

console.log(randomColor());       // e.g. "#3FA2C7"
console.log(randomPassword());    // e.g. "Aq9#tL2@Xf"
console.log(randomPassword(16));  // length = 16

CommonJS (CJS projects)

If this package is ESM-only, use dynamic import:

(async () => {
  const { randomColor, randomPassword } = await import('@adaikkappan_ramaiah/random-gen');
  console.log(randomColor());
  console.log(randomPassword(12));
})();

Browser (via CDN)

<script type="module">
  import { randomColor, randomPassword } from 'https://unpkg.com/@adaikkappan_ramaiah/random-gen?module';
  document.body.style.backgroundColor = randomColor();
  console.log(randomPassword(12));
</script>

API

  • randomColor(): string

    • Returns a 7‑character hex color string in the form #RRGGBB using uppercase hex digits (0–9, A–F).
    • Example: "#12ABEF"
  • randomPassword(len = 10): string

    • Returns a random string of the requested length (default 10).
    • Character set: A–Z a–z 0–9 @ # $ % ^ & *
    • The len parameter is coerced via Number(len). Pass a valid number (e.g., 8, 12, 16).
    • Examples:
      • randomPassword() → length 10
      • randomPassword(16) → length 16

Security

  • This package uses Math.random() and is NOT a cryptographically secure RNG.
  • Do not use for passwords, secrets, tokens, or any security‑critical code.
  • For secure randomness in Node.js, use the Crypto module:
import { randomBytes } from 'node:crypto';
const token = randomBytes(16).toString('hex'); // 32 hex chars

TypeScript

No types are required to use this package. If you prefer, you can add a minimal ambient declaration in your project:

declare module '@adaikkappan_ramaiah/random-gen' {
  export function randomColor(): string;
  export function randomPassword(len?: number | string): string;
}

License

ISC © 2025 ADAIKKAPPAN2310

Links

  • npm: https://www.npmjs.com/package/@adaikkappan_ramaiah/random-gen
  • Repository: https://github.com/ADAIKKAPPAN2310/Random-gen