authentication/scripts/saltedkey.py

6 lines
145 B
Python
Raw Permalink Normal View History

2025-01-20 17:52:27 +07:00
import bcrypt
import hashlib
def token(username, hashed):
return hashlib.sha1( (username+username[:3]+hashed[-6:]).encode() ).hexdigest()