HashGenerator
1.0.0
HashGenerator เป็นแพ็คเกจ Python อย่างง่ายเพื่อคำนวณแฮชของไฟล์โดยใช้อัลกอริทึมแฮชต่างๆ
ในการติดตั้งแพ็คเกจให้ใช้ PIP:
pip install HashGenerator นี่คือวิธีที่คุณสามารถใช้แพ็คเกจ HashGenerator เพื่อคำนวณแฮชไฟล์:
from HashGenerator import calculate_hash
# Calculate SHA-256 hash
hash_value = calculate_hash ( 'path/to/your/file.txt' , 'sha256' )
print ( f"SHA-256: { hash_value } " )
# Calculate MD5 hash
hash_value = calculate_hash ( 'path/to/your/file.txt' , 'md5' )
print ( f"MD5: { hash_value } " )
# Calculate SHA-512 hash
hash_value = calculate_hash ( 'path/to/your/file.txt' , 'sha512' )
print ( f"SHA-512: { hash_value } " )สนับสนุนอัลกอริทึมการแฮชต่อไปนี้:
นี่คือตัวอย่างของวิธีการใช้แพ็คเกจ HashGenerator :
from HashGenerator import calculate_hash
file_path = 'example.txt'
algorithm = 'sha256'
hash_value = calculate_hash ( file_path , algorithm )
print ( f"The { algorithm } hash of the file is: { hash_value } " )