mirror of
https://github.com/frappe/frappe_docker.git
synced 2026-06-20 23:05:09 +00:00
12 lines
360 B
Python
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
|