17 lines
330 B
Python
17 lines
330 B
Python
#!/usr/bin/env python
|
|
# -*- coding: utf-8 -*-
|
|
|
|
import hashlib
|
|
|
|
passwords = [
|
|
"123456",
|
|
"password",
|
|
"admin123",
|
|
]
|
|
|
|
print("=== Python SHA256 密码加密测试 ===")
|
|
for pwd in passwords:
|
|
hash_result = hashlib.sha256(pwd.encode('utf-8')).hexdigest()
|
|
print(f"密码: {pwd}")
|
|
print(f"SHA256: {hash_result}\n")
|