File: main.py

package info (click to toggle)
python-zxcvbn 1.0%2Bgit20130503.bc1c2d-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 9,524 kB
  • ctags: 100
  • sloc: python: 935; makefile: 16
file content (12 lines) | stat: -rw-r--r-- 358 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
import time

from zxcvbn.matching import omnimatch
from zxcvbn.scoring import minimum_entropy_match_sequence


def password_strength(password, user_inputs=[]):
    start = time.time()
    matches = omnimatch(password, user_inputs)
    result = minimum_entropy_match_sequence(password, matches)
    result['calc_time'] = time.time() - start
    return result