labm8.crypto¶
Hashing and cryptography utils.
-
labm8.crypto.md5(data)¶ Return the md5 of “data”.
Parameters: data (bytes) – Data. Returns: Hex encoded. Return type: str
-
labm8.crypto.md5_file(path)¶ Return the md5 of file at “path”.
Parameters: path (str) – Path to file Returns: Hex encoded. Return type: str
-
labm8.crypto.md5_list(*elems)¶ Return the md5 of all elements of a list.
Parameters: *elems – List of stringifiable data. Returns: Hex encoded. Return type: str
-
labm8.crypto.md5_str(string, encoding='utf-8')¶ Return the md5 of string “data”.
Parameters: string – String. Returns: Hex encoded. Return type: str
-
labm8.crypto.sha1(data)¶ Return the sha1 of “data”.
Parameters: data (bytes) – Data. Returns: Hex encoded. Return type: str
-
labm8.crypto.sha1_file(path)¶ Return the sha1 of file at “path”.
Parameters: path (str) – Path to file Returns: Hex encoded. Return type: str
-
labm8.crypto.sha1_list(*elems)¶ Return the sha1 of all elements of a list.
Parameters: *elems – List of stringifiable data. Returns: Hex encoded. Return type: str
-
labm8.crypto.sha1_str(string, encoding='utf-8')¶ Return the sha1 of string “data”.
Parameters: string – String. Returns: Hex encoded. Return type: str
-
labm8.crypto.sha256(data)¶ Return the sha256 of “data”.
Parameters: data (bytes) – Data. Returns: Hex encoded. Return type: str
-
labm8.crypto.sha256_file(path)¶ Return the sha256 of file at “path”.
Parameters: path (str) – Path to file Returns: Hex encoded. Return type: str
-
labm8.crypto.sha256_list(*elems)¶ Return the sha256 of all elements of a list.
Parameters: *elems – List of stringifiable data. Returns: Hex encoded. Return type: str
-
labm8.crypto.sha256_str(string, encoding='utf-8')¶ Return the sha256 of string “data”.
Parameters: string – String. Returns: Hex encoded. Return type: str