7 lines
216 B
Python
7 lines
216 B
Python
|
from hashlib import sha256
|
||
|
import time
|
||
|
|
||
|
# password = hashed password
|
||
|
def generate_token(password, salt):
|
||
|
time = time.strftime('%d%m%Y%H%M')
|
||
|
token = sha256((password + salt + time).encode('utf-8')).hexdigest()
|