pssecret-server/pssecret/utils.py
2024-12-25 18:35:01 +01:00

11 lines
213 B
Python

from uuid import uuid4
from pssecret.redis_db import redis
async def get_new_key() -> str:
while True:
new_key = str(uuid4())
if not await redis.exists(new_key):
return new_key