@systemix/password

A cryptographically secure password generator with customizable complexity and entropy tools.

Installation

ts
pnpm add @systemix/password

Basic Usage

ts
import { generatePassword } from '@systemix/password';

const password = generatePassword();
// Default: 12 chars, lowercase + uppercase + numbers

Options

PropertyTypeDefaultDescription
lengthnumber12Password length (1–100)
useNumbersbooleantrueInclude 0–9
useUppercasebooleantrueInclude A–Z
useLowercasebooleantrueInclude a–z
useSymbolsbooleanfalseInclude special characters
minNumbersnumber0Minimum numbers required
minUppercasenumber0Minimum uppercase required
minLowercasenumber0Minimum lowercase required
minSymbolsnumber0Minimum symbols required
excludeSimilarCharactersbooleanfalseExclude visually similar chars
countnumber1Number of passwords to generate

Examples

Strong password with symbols

ts
const password = generatePassword({
  length: 16,
  useSymbols: true,
  minNumbers: 2,
  minSymbols: 2,
});

Entropy calculation

ts
import { calculatePasswordEntropy } from '@systemix/password';

const entropy = calculatePasswordEntropy(16, 94); // length, charset size
console.log(`Entropy: ${entropy.toFixed(1)} bits`);

Try it

Open the Password Generator demo to experiment interactively.