cketfs-java.3.2.0.source-code.checksumUdf.py Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bucketfs-java Show documentation
Show all versions of bucketfs-java Show documentation
Java library for automating tasks on Exasol's BucketFS.
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()