mirror of
https://github.com/Threnklyn/esphome-dev.git
synced 2026-05-19 20:53:26 +02: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
10 lines
285 B
Python
10 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()
|