Use this function if you want to store a password. This function returns a hex representation of the password that is safe to be stored. It uses a one-way algorithm which means you need to provide the password you are trying to verify in compare_stored_password() as one of the parameters.
Parameters: |
|
---|---|
Returns: | str – Returns the password prepared for storage. |
Use this function to verify a password given by a user against a password stored with prepare_password_for_storage().
Parameters: |
|
---|---|
Returns: | bool – True if the given password matches the stored one. |
Generates a password according to the given parameters. It is guaranteed that if a type of characters (lower, upper, etc.) is allowed in the password, then the generated password will always contain at least one character of that type, e.g. if the parameter special is True, then the generated password will have at least a special character.
Parameters: |
|
---|---|
Returns: | str – The generated password. |
Validates a given password against some basic rules.
Parameters: |
|
---|---|
Returns: | list – A list with the name of the parameters whose validations have failed. This means a password is valid only if this function returns an empty list. |
Evaluate a password’s strength according to some heuristics.
Parameters: |
|
---|---|
Returns: | int – Strength of the password as an int between 0 and 100. |
Evaluate a password’s strength according to some heuristics. Returns the entropy of the given password in bits.
E.g. a password with 8 characters, lowercase + digits, without dictionary words and without keyboard sequences, will have entropy about 26. If it had also uppercase characters the entropy would be about 30.
Parameters: |
|
---|
returns: int – Number of bits of entropy that the password has.