checksums
ensembl.utils.checksums
¶
    Utils for common hash operations (often referred to as checksums) over files, e.g. MD5 or SHA128.
get_file_hash(file_path, algorithm='md5')
¶
    Returns the hash value for a given file and hash algorithm.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
| file_path | StrPath | File path to get the hash for. | required | 
| algorithm | str | Secure hash or message digest algorithm name. | 'md5' | 
Source code in src/ensembl/utils/checksums.py
              | 23 24 25 26 27 28 29 30 31 32 33 34 |  | 
validate_file_hash(file_path, hash_value, algorithm='md5')
¶
    Returns true if the file's hash value is the same as the one provided for that hash algorithm, false otherwise.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
| file_path | StrPath | Path to the file to validate. | required | 
| hash_value | str | Expected hash value. | required | 
| algorithm | str | Secure hash or message digest algorithm name. | 'md5' | 
Source code in src/ensembl/utils/checksums.py
              | 37 38 39 40 41 42 43 44 45 46 47 |  |