mirror of
https://github.com/ansible-collections/community.mysql.git
synced 2025-08-22 05:51:45 -07:00
[ci skip] fix change with hex
This commit is contained in:
parent
51f2c05ea4
commit
9cc277a60a
2 changed files with 13 additions and 4 deletions
|
@ -108,8 +108,8 @@ def _sha256_digest(key, salt, loops):
|
|||
return tmp
|
||||
|
||||
|
||||
def mysql_sha256_password_hash_hex(password, salt):
|
||||
"""Return a MySQL compatible caching_sha2_password hash in hex format."""
|
||||
def mysql_sha256_password_hash(password, salt):
|
||||
"""Return a MySQL compatible caching_sha2_password hash in raw format."""
|
||||
if len(salt) != 20:
|
||||
raise ValueError("Salt must be 20 characters long.")
|
||||
|
||||
|
@ -118,3 +118,8 @@ def mysql_sha256_password_hash_hex(password, salt):
|
|||
|
||||
digest = _sha256_digest(password, salt, iteration)
|
||||
return "$A${0:>03}${1}{2}".format(count, salt, digest).encode().hex().upper()
|
||||
|
||||
|
||||
def mysql_sha256_password_hash_hex(password, salt):
|
||||
"""Return a MySQL compatible caching_sha2_password hash in hex format."""
|
||||
return mysql_sha256_password_hash(password, salt).encode().hex().upper()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue