Module Contents
Classes
Allows checksum generation of binary data either from a file or message. |
- class Hasher
Allows checksum generation of binary data either from a file or message.
- get_file_checksum(filename, block=2**20)
|coro|Generates a calculated
SHA512hash for a given file.- Parameters:
- Returns:
The calculated
SHA512hash of the file, orNoneif there was an error generating the checksum.- Return type:
Notes
This function generates a
SHA512hash for a given file by reading the file in blocks and hashing each block. The generated hash is a digest checksum (a unique fixed-sized representation of the file content) and the file is treated as a binary file (read inrbmode) for proper handling of all types of files.The reason
SHA512was chosen is purely for the lack of collisions at runtime when performing dynamic checks.