Skip to content

tetherto/pearpass-utils-password-check

Repository files navigation

pearpass-utils-password-check

A utility library to check the strength of passwords and passphrases based on configurable rules.

Table of Contents

Features

This utility provides functions to check the strength of passwords and passphrases based on configurable rules:

Password Validation:

  • Minimum length requirements
  • Uppercase and lowercase character inclusion
  • Number inclusion
  • Special character inclusion

Passphrase Validation:

  • Minimum word count
  • Unique words verification
  • Capital letter inclusion
  • Symbol inclusion
  • Number inclusion

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-check.git

Usage Examples

Checking Password Strength

import { checkPasswordStrength } from '@tetherto/pearpass-utils-password-check';

// With default rules
const result = checkPasswordStrength('Test123!');
console.log(result.strengthType); // safe

// With custom rules
const customResult = checkPasswordStrength('Test1234', {
    length: 8,
    includeSpecialChars: false,
    lowerCase: true,
    upperCase: true,
    numbers: true
});
console.log(customResult.strengthType); // safe
console.log(customResult.rules); // Detailed rules assessment

Checking Passphrase Strength

import { checkPassphraseStrength } from '@tetherto/pearpass-utils-password-check';

// With default rules
const words = ['Test1!', 'Word2@', 'Example3#', 'Unique', 'Safe', 'Pass', 'Phrase', 'Another4$'];
const result = checkPassphraseStrength(words);
console.log(result.strength); // safe

// With custom rules
const customResult = checkPassphraseStrength(words, {
    capitalLetters: true,
    symbols: true,
    numbers: true,
    words: 6
});
console.log(customResult.strengthType); // safe
console.log(customResult.rules); // Detailed rules assessment

Dependencies

This package has no runtime 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