timmy / 使用 hashlib 進行哈希運算
0 j'aimes
0 forks
4 fichiers
Dernière activité 9 months ago
| 1 | import hashlib |
| 2 | |
| 3 | data = "Hello, World!".encode() # 轉換為位元組 |
| 4 | hash_object = hashlib.sha256(data) |
| 5 | hash_hex = hash_object.hexdigest() |
| 6 | |
| 7 | print(f"SHA-256 雜湊值: {hash_hex}") |
Plus récent
Plus ancien