[New-bugs-announce] [issue35778] RF: ``pathlib.Path.checksum()`` member

Oscar Esteban report at bugs.python.org
Fri Jan 18 18:29:15 EST 2019


New submission from Oscar Esteban <oesteban at 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 <report at bugs.python.org>
<https://bugs.python.org/issue35778>
_______________________________________


More information about the New-bugs-announce mailing list