New submission from Oscar Esteban <oeste...@stanford.edu>:
Gauging the interest in a checksum calculation function built-in Path objects: ``` >>> Path('somefile.img').checksum() '4976c36bacf922cbc5c811c9c288e61d' >>> Path('somefile.img').checksum(hash='md5') '4976c36bacf922cbc5c811c9c288e61d' >>> Path('somefile.img').checksum(hash='sha256') '12917abe21e1eb4ba3c704600db53a1ff1434b3259422b86bfd08afa8216e4aa' >>> Path.home().checksum() '798d3a5c2b679750a90e91b09cf93129' >>> Path.home().checksum(hash='sha256') 'b3e04961fd54818d93aac305db4a3dec51b9731808c19ea9c59460c841e2d145' # Do not checksum content, just the file's path, as for directories >>> Path('somefile.img').checksum(content=False) '3fb531e352cbc2e2103ab73ede40f2d6' ``` ---------- components: Library (Lib) messages: 334023 nosy: oesteban priority: normal severity: normal status: open title: RF: ``pathlib.Path.checksum()`` member type: enhancement versions: Python 3.7, Python 3.8 _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue35778> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com