HashGenerator
1.0.0
HashGenerator est un simple package Python pour calculer le hachage d'un fichier à l'aide de divers algorithmes de hachage.
Pour installer le package, utilisez PIP:
pip install HashGenerator Voici comment vous pouvez utiliser le package HashGenerator pour calculer les hachages de fichiers:
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 } " )Les algorithmes de hachage suivants sont pris en charge:
Voici un exemple de la façon d'utiliser le package 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 } " )