Skip to content

PearPass is an open-source, privacy-first password manager with peer-to-peer syncing and end-to-end encryption. This repository contains shared core components used across the PearPass apps.

License

Notifications You must be signed in to change notification settings

tetherto/pearpass-utils-password-generator

Repository files navigation

pearpass-utils-password-generator

An utility package for generating secure passwords and passphrases.

Table of Contents

Features

  • Generate secure passwords with customizable options
    • Configurable length
    • Include/exclude special characters
    • Include/exclude lowercase letters
    • Include/exclude uppercase letters
    • Include/exclude numbers
  • Generate memorable passphrases with configurable settings
    • Adjustable word count
    • Optional capitalization
    • Optional number suffixes
    • Optional symbol suffixes

Installation

npm install pearpass-utils-password-generator

Usage Examples

import { generatePassword, generatePassphrase } from 'pearpass-utils-password-generator';

// Generate a password
const password = generatePassword(12, {
    includeSpecialChars: true,
    lowerCase: true,
    upperCase: true,
    numbers: true
});

// Generate a passphrase
const passphrase = generatePassphrase(true, true, true, 4);

Password Generation

// Generate a 16-character password with all character types
const strongPassword = generatePassword(16);

// Generate a 12-character password without special characters
const simplePassword = generatePassword(12, { includeSpecialChars: false });

// Generate a numeric PIN
const pin = generatePassword(6, {
    includeSpecialChars: false,
    lowerCase: false,
    upperCase: false,
    numbers: true
});

Passphrase Generation

// Generate a 4-word passphrase with capitalization, symbols, and numbers
const complexPassphrase = generatePassphrase(true, true, true, 4);
// Example: "Guitar5$ Elephant3# Balloon7^ Dog2&"

// Generate a simple 3-word passphrase
const simplePassphrase = generatePassphrase(false, false, false, 3);
// Example: "river camera piano"

Dependencies

This package has no production dependencies.

Related Projects

License

This project is licensed under the Apache License, Version 2.0. See the LICENSE file for details.

About

PearPass is an open-source, privacy-first password manager with peer-to-peer syncing and end-to-end encryption. This repository contains shared core components used across the PearPass apps.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 6