hashes#

pathlib_mate.hashes.get_text_fingerprint(text, hash_meth, encoding='utf-8')[source]#

Use default hash method to return hash value of a piece of string default setting use ‘utf-8’ encoding.

pathlib_mate.hashes.md5file(abspath, nbytes=0, chunk_size=64)[source]#

Return md5 hash value of a piece of a file

Estimate processing time on:

Parameters:
  • abspath – the absolute path to the file

  • nbytes – only has first N bytes of the file. if 0 or None, hash all file

CPU = i7-4600U 2.10GHz - 2.70GHz, RAM = 8.00 GB 1 second can process 0.25GB data

  • 0.59G - 2.43 sec

  • 1.3G - 5.68 sec

  • 1.9G - 7.72 sec

  • 2.5G - 10.32 sec

  • 3.9G - 16.0 sec

pathlib_mate.hashes.sha256file(abspath, nbytes=0, chunk_size=64)[source]#

Return sha256 hash value of a piece of a file

Estimate processing time on:

Parameters:
  • abspath – the absolute path to the file

  • nbytes – only has first N bytes of the file. if 0 or None, hash all file

pathlib_mate.hashes.sha512file(abspath, nbytes=0, chunk_size=64)[source]#

Return sha512 hash value of a piece of a file

Estimate processing time on:

Parameters:
  • abspath – the absolute path to the file

  • nbytes – only has first N bytes of the file. if 0 or None, hash all file