dashboard: fix subprocesses blocking the event loop (#5772)

* dashboard: fix subprocesses blocking the event loop

- break apart the util module
- adds a new util to run subprocesses with asyncio

* take a list
This commit is contained in:
J. Nick Koston
2023-11-15 18:07:51 -06:00
committed by GitHub
parent 4e3170dc95
commit 3644853d38
9 changed files with 101 additions and 70 deletions
+11
View File
@@ -0,0 +1,11 @@
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()