Git Product home page Git Product logo

p-meter's Introduction

P-METER ๐Ÿ“

pMeter

Build Status ย  Coverage Status

quick way to measure the strength of the password.

The purpose of this module is to analyze the password and then categorize it according to our rules mentioned in the documentation where you can view the result numerical or textual.

NOTE: we verify that a blank password or that there are spaces are passed to the module function.

Installation

# npm
$ npm install p-meter
# yarn
$ yarn add p-meter

Usage

const pwdMeter = require('p-meter')
const password = '199812+imeD'
// 1.x.x
// const result = pwdMeter (password, { displayString: true, useSpace: false })
// 2.x.x
// the default value of displayString and useSpace is false 
const result = pwdMeter (password, { displayString: true })

NOTE: This example is the simplest thing to write. For more examples you will find them in a section of exemples.

Examples

The result can be displayed in a two different way (Numerical or Textual). In this section we illustrate the two ways of seeing the result.

1- Numerical:

-1 0 1 2 3 4 5 6
// 1.x.x 
const result = passwordMeter(password, { displayString: false, useSpace: false })
// 2.x.x
// the default value of displayString and useSpace is false
const result = passwordMeter(password)

2 - Textual :

ERROR FAIBLE AVG ABOVE AVG STRONG AVG FORT ABOVE FORT STRONG FORT
// 1.x.x
const result = passwordMeter(password, { displayString: true, useSpace: false })
// 2.x.x
// the default value of displayString and useSpace is false
const result = passwordMeter(password, { displayString: true })

Rules

We can divide passwords into four categories (numbers, uppercase alphabet, lowercase alphabet and special characters) ..

We have 8 levels of results:

  • Level 1 (-1 or ERROR): If you have an invalid password that is empty or composed of spaces.
  • Level 2 (0 or LOW): If there is only one category in the password of the four.
  • Level 3 (1 or AVG): if there are two categories in the password and the special characters do not belong to them.
  • Level 4 (2 or ABOVE AVG): if there are two categories in the password and the special characters belong to it.
  • Level 5 (3 or STRONG AVG): If you have three categories and the special characters do not belong to them.
  • Level 6 (4 or FORT): If you have three categories and the special characters belong to them.
  • Level 7 (5 or ABOVE FORT): if all categories are present.
  • Level 8 (6 or STRONG FORT): If all categories are present with the following characteristics:
    • If uppercase letters are at least 30% of the password length, lowercase letters must be at least 10%.
    • If lowercase letters represent 30% of the length of the password, the capital letters must represent at least 10%.
    • Special characters must be at least 20%.

License


MIT

p-meter's People

Contributors

3imed-jaberi avatar

Stargazers

Chehir Dhawedi avatar Ridha Mezrigui avatar Fortas Abdeldjalil avatar Ahmed Rebai avatar Yassine Omrani avatar

Forkers

p-utils

p-meter's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.