mirror of
https://github.com/esphome/esphome.git
synced 2024-11-26 17:05:21 +01:00
c030be4d3f
* Fix dashboard logout button and py3.8 removed hmac.new digestmod * Just use SHA256 No reason to use HMAC here, as authenticity is not an issue * Wrong branch * Clenaup
9 lines
285 B
Python
9 lines
285 B
Python
import hashlib
|
|
|
|
|
|
def password_hash(password: str) -> bytes:
|
|
"""Create a hash of a password to transform it to a fixed-length digest.
|
|
|
|
Note this is not meant for secure storage, but for securely comparing passwords.
|
|
"""
|
|
return hashlib.sha256(password.encode()).digest()
|