hash¶
Classes¶
Functions¶
|
|
|
Compute md5 hexadecimal digest of a file. |
|
Compute sha1 hexadecimal digest of a file. |
|
Compute sha256 hexadecimal digest of a file. |
|
Compute sha512 hexadecimal digest of a file. |
Module Contents¶
- class hash.HashError¶
Bases:
e3.error.E3Error
- hash.__compute_hash(path: os.PathLike[str] | str, kind: Literal['md5'] | Literal['sha1'] | Literal['sha256'] | Literal['sha512']) str¶
- hash.md5(path: os.PathLike[str] | str) str¶
Compute md5 hexadecimal digest of a file.
- Parameters:
path – path to a file
- Returns:
the hash of the file content
- Raises:
HashError – in case of error
- hash.sha1(path: os.PathLike[str] | str) str¶
Compute sha1 hexadecimal digest of a file.
- Parameters:
path (str) – path to a file
- Returns:
the hash of the file content
- Raises:
HashError – in case of error