Skip to content

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

Security Notice

  1. To ensure the security and integrity of your projects, please note that official PearPass packages are distributed exclusively through our GitHub organization.
  2. Any packages with similar names found on the npm registry or other third-party package managers are not affiliated with PearPass and should be strictly avoided. We recommend installing directly from this repository to ensure you are using the verified, open-source version.

Installation

npm install git+https://github.com/tetherto/pearpass-utils-password-generator.git

Usage Examples

import { generatePassword, generatePassphrase } from '@tetherto/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

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors