diff options
| author | Adam Soltys <[email protected]> | 2015-11-28 23:57:34 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2015-11-30 21:10:59 -0800 |
| commit | 41f8c6831bb91c0b0be1219b1566e59e48673465 (patch) | |
| tree | 39626cf1a8fe7b8d73f750ccaf433bfa8c425d6b /public/js/score_password.js | |
| parent | f2bff842cbe16c18923b905f70ed168096648727 (diff) | |
| download | coinos-server-41f8c6831bb91c0b0be1219b1566e59e48673465.tar.gz coinos-server-41f8c6831bb91c0b0be1219b1566e59e48673465.zip | |
Use bower, grunt and browserify instead of connect-assets
Diffstat (limited to 'public/js/score_password.js')
| -rw-r--r-- | public/js/score_password.js | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/public/js/score_password.js b/public/js/score_password.js deleted file mode 100644 index a28001fa..00000000 --- a/public/js/score_password.js +++ /dev/null @@ -1,28 +0,0 @@ -function scorePassword(pass) { - var score = 0; - if (!pass) - return score; - - // award every unique letter until 5 repetitions - var letters = new Object(); - for (var i=0; i<pass.length; i++) { - letters[pass[i]] = (letters[pass[i]] || 0) + 1; - score += 5.0 / letters[pass[i]]; - } - - // bonus points for mixing it up - var variations = { - digits: /\d/.test(pass), - lower: /[a-z]/.test(pass), - upper: /[A-Z]/.test(pass), - nonWords: /\W/.test(pass), - } - - variationCount = 0; - for (var check in variations) { - variationCount += (variations[check] == true) ? 1 : 0; - } - score += (variationCount - 1) * 10; - - return parseInt(score); -} |
