@if24b231/password-utilities
v1.0.0
Published
Password Generator & Validator
Downloads
66
Readme
password-utilities
A small library that is able to generate strong passwords and also check if given passwords are strong
Table of Contents
Installation
Install via npm:
npm install @if24b231/password-utilitiesInstall via yarn:
yarn add @if24b231/password-utilitiesUsage
Basic Usage
const index = require('./dist/index.cs');
const generateStrongPassword = require('../dist/index');
const isStrongPassword = require('../dist/index');
const passwordLength = 5;
const weakPassword = "NotAStrongPassword";
const strongPassword = "ThisIsStr0ngPassw#rd_"
console.log(generateStrongPassword(passwordLength)); // djgD_
console.log(isStrongPassword(weakPassword)); // False
console.log(isStrongPassword(strongPassword)); // TrueExamples
Generates a strong password
const index = require('./dist/index.js');
const generateStrongPassword = require('../dist/index');
const requiredLengthForPassword = 9;
const strongPassword = toSnakeCase(requiredLengthForPassword);
console.log(strongPassword); // 'RdfhDgD?!'
Validates a password for security reasons
const isStrongPassword = require('../dist/index');
const title = 'MyStrongPassword#K3k';
const isSecure = isStrongPassword(isStrongPassword);
console.log(isSecure); // 'True'Format a sentence for a URL slug:
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.
