All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cketfs-java.3.2.0.source-code.checksumUdf.py Maven / Gradle / Ivy

The newest version!
import hashlib

BLOCK_SIZE = 8192


def run(context):
    with open(context.my_path, "rb") as f:
        file_hash = hashlib.sha512()
        chunk = f.read(BLOCK_SIZE)
        while chunk:
            file_hash.update(chunk)
            chunk = f.read(BLOCK_SIZE)
    return file_hash.hexdigest()




© 2015 - 2024 Weber Informatics LLC | Privacy Policy