shareable upload tokens

This commit is contained in:
Q
2023-08-28 22:13:22 +03:00
parent 4629bf2976
commit 3b69ce7ae1
6 changed files with 145 additions and 8 deletions

View File

@@ -6,8 +6,8 @@ import passlib.hash
VALID_TOKEN_CHARS = string.digits + string.ascii_letters
def random_token():
return "".join(secrets.choice(VALID_TOKEN_CHARS) for i in range(8))
def random_token(n=8):
return "".join(secrets.choice(VALID_TOKEN_CHARS) for i in range(n))
def file_date_human(num):