Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
/ tsop Public

You can determine the strength of your password through this

License

Notifications You must be signed in to change notification settings

eidonjoe/tsop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

4 Commits

Repository files navigation

##What is tsop? It's the strength of password.

You can determine the strength of your password through this.

##Usage ####First, install the tsop with npm:

 $ 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 = require('tsop');
 tsop.verify('111111'); // => 'weak'
 tsop.verify('qweqwe'); // => 'weak'
 tsop.verify('123123123123'); // => 'middle'
 tsop.verify('123qwe'); // => 'middle'
 tsop.verify('123qwe!@#'); // => 'strong'
 
 // if mix == true ,it will not allow use a purely number or a purely letter string to be password 
 tsop.verify('111111',true); // => 'disable'
 tsop.verify('qweqwe',true); // => 'disable'
 tsop.verify('!@#!@#',true); // => 'weak'
 tsop.verify('qwe!@#',true); // => 'middle'
 tsop.verify('123qwe',true); // => 'middle'
 tsop.verify('123qwe!@#',true); // => 'strong'
 

##Test

 $ npm install mocha

go to the dir where you installed tsop

 $ mocha

console output

 test.js
 - 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

About

You can determine the strength of your password through this

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

AltStyle によって変換されたページ (->オリジナル) /