pssecret-server/src/pssecret/utils.py

12 lines
213 B
Python
Raw Normal View History

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