mirror of
https://github.com/esphome/esphome.git
synced 2024-12-13 17:04:54 +01:00
3644853d38
* dashboard: fix subprocesses blocking the event loop - break apart the util module - adds a new util to run subprocesses with asyncio * take a list
11 lines
321 B
Python
11 lines
321 B
Python
from __future__ import annotations
|
|
|
|
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()
|