Files
sdgb-utils-rs/utils/hasher.py
2025-08-04 01:55:44 +08:00

9 lines
207 B
Python

import hashlib
def salted_hash_userid(user_id: int):
SALT = b"Lt2N5xgjJOqRsT5qVt7wWYw6SqOPZDI7"
hash_uid = hashlib.sha256(f"{user_id}".encode("utf-8") + SALT)
return hash_uid.hexdigest()[:16]