maci.createfilehash
hash a file and store hash to file
Creates a hash of any file, and stores the hash data to a newly created file. Always returns a string of the file hash. Useful to use alongside its partner function as mentioned below.
maci.createfilehash -> str
Basic Example of hashing a file and storing its hash using default positional parameters
In this example, we simply input the source file to hash and the destination file to store the hash data using the createfilehash function and pass the file locations as arguments to the function, and the hashed data is then stored to the destination file.
This tool is encouraged to be used alongside its partner function comparefilehash, which will automatically handle comparing the hash data stored against the source file hashed and return a Trur/False if they match.
disable creating destination file
createfilehash always returns the hash of the source file to a string if needing to store it in code whether you create a destination file or not. However, you may also disable the need for a destination file to store the hash by setting the file_to_store_hash parameter to None.
Example disabling creating a destination file and just collecting the hash
partner functions
Functions that are related for createfilehash
maci.comparefilehash -> Compares previously created file with stored hash with the source file hash
parameters & arguments
Describes all parameter functionality and accepted data types
Last updated