@if24b097/password-utilities-v1
v1.1.0
Published
> A small library that generates passwords and checks their strength.
Readme
@if24b097/password-utilities-v1
A small library that generates passwords and checks their strength.
Table of Contents
Installation
Install via npm:
npm install @if24b097/password-utilities-v1Install via yarn:
yarn add @if24b097/password-utilities-v1Usage
Basic Usage
import {generateStrongPassword, isStrongPassword} from '@if24b097/password-utilities-v1';
const pw = generateStrongPassword(8); //password with length 8
console.log("Password" +pw); //log password
console.log("is strong: "+ isStrongPassword(pw)); //log strengthExamples
import {generateStrongPassword, isStrongPassword} from '@if24b097/password-utilities-v1';
//EXAMPLE 1: generate password with length 12
const pw2 = generateStrongPassword(12); //--> pw = "pC%mD8TpCKn2"
console.log("Password" +pw2); //"Password: pC%mD8TpCKn2"
//EXAMPLE 2: test weak password "Hello World"
console.log("is strong: "+ isStrongPassword("Hello World")); //"is strong: false"
//EXAMPLE 3: test strong password "pC%mD8TpCKn2"
console.log("is strong: "+ isStrongPassword("pC%mD8TpCKn2")); //"is strong: true"Contribution
Contributions are welcome! Please see CONTRIBUTING.md for more details.
Security
Please refer to our SECURITY.md for information about our security policies, how to report vulnerabilities, and our approach to handling security concerns.
Important Note: This library uses non-cryptographic randomness (Math.random()). Do not rely on it for security-critical functionality.
License
This project is licensed under the MIT License.
