new short expiring url for files
This commit is contained in:
@@ -4,6 +4,7 @@ import base64
|
||||
#~ from Crypto.Cipher import AES
|
||||
import hashlib
|
||||
|
||||
|
||||
#~ class Crypto:
|
||||
#~ def __init__(self, secret):
|
||||
#~ self.secret = add_pad(secret[0:16])
|
||||
@@ -68,6 +69,14 @@ def random_token():
|
||||
return token
|
||||
|
||||
|
||||
def random_expiring_hash():
|
||||
codes = []
|
||||
for i in range(3):
|
||||
codes.append("".join([random.choice(string.ascii_letters + string.digits) for n in range(4)]))
|
||||
ehash = "-".join(codes)
|
||||
return ehash
|
||||
|
||||
|
||||
def remove_pad(string):
|
||||
""" Remove spaces from right """
|
||||
return string.rstrip(" ")
|
||||
|
||||
Reference in New Issue
Block a user