hal.hashes package

Submodules

hal.hashes.md5 module

MD5 hash

hal.hashes.md5.file_to_md5(filename, block_size=8192)[source]

Calculate the md5 hash of a file. Memory-friendly solution, it reads the file piece by piece. See stackoverflow.com/questions/1131220/

Parameters:
  • filename – filename to convert
  • block_size – size of block
Returns:

MD5 hash of file content

hal.hashes.md5.string_to_md5(content)[source]

Calculate the md5 hash of a string. This ‘string’ can be the binary content of a file too

Parameters:content – string to convert
Returns:MD5 hash of content