Debian Codegraph @

testing/e2e/mqtt/shoutrrr-user-pw-hash.py

raw
1 import hashlib
2 import os
3
4 password = "testing"
5 salt = os.urandom(16).hex()
6 to_hash = salt + password
7 hash_hex = hashlib.sha256(to_hash.encode()).hexdigest()
8
9 print("Salt:", salt)
10 print("Password hash:", hash_hex)