HashGenerator
1.0.0
O hashgenerator é um pacote Python simples para calcular o hash de um arquivo usando vários algoritmos de hash.
Para instalar o pacote, use PIP:
pip install HashGenerator Veja como você pode usar o pacote HashGenerator para calcular os hashes de arquivos:
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 } " )Os seguintes algoritmos de hash são suportados:
Aqui está um exemplo de como usar o pacote 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 } " )