What is tsop?
It's the strength of password.
You can determine the strength of your password through this.
Usage
npm
:
First, install the tsop with $ npm install tsop
Then use in your project
tsop exports just a function verify()
and two parameters password
,mix
/** * tsop.verify(password[, mix]) * @param {[string]} password [necessarily] * @param {[boolen]} mix [optional] * @return {[string]} */ var tsop = ; tsop; // => 'weak' tsop; // => 'weak' tsop; // => 'middle' tsop; // => 'middle' tsop; // => 'strong' // if mix == true ,it will not allow use a purely number or a purely letter string to be password tsop; // => 'disable' tsop; // => 'disable' tsop; // => 'weak' tsop; // => 'middle' tsop; // => 'middle' tsop; // => 'strong'
Test
$ npm install mocha
go to the dir where you installed tsop
$ mocha
console output
testjs - mix == false or no mix parameter ✓ should return weak when password === 111111 ✓ should return weak when password === qweqwe ✓ should return middle when password === 123123123123 ✓ should return middle when password === 123qwe ✓ should return strong when password === 123qwe!@# - mix == true ✓ should return disable when password === 111111 ✓ should return disable when password === qweqwe ✓ should return weak when password === !@#!@# ✓ should return middle when password === qwe!@# ✓ should return middle when password === 123qwe ✓ should return strong when password === 123qwe!@#
License
The MIT License (MIT)
Copyright (c) 2016 eidonjoe