frappe_docker/frappe-bench/env/lib/python2.7/site-packages/zxcvbn/main.py
2017-07-31 15:51:51 +05:30

12 lines
360 B
Python

import time
from zxcvbn.matching import omnimatch
from zxcvbn.scoring import minimum_entropy_match_sequence
def password_strength(password, user_inputs=None):
start = time.time()
matches = omnimatch(password, user_inputs)
result = minimum_entropy_match_sequence(password, matches)
result['calc_time'] = time.time() - start
return result