hash_file_content

hash_file_content#

hash_file_content(file_content: str, len_param: int = 5) str[source]#

Hash a file into a unique str.

Parameters:
  • file_content (str) – File content

  • len_param (int) – Length parameter for the hash (length of the key will be 2x this number)

Returns:

Hashed file content

Return type:

str

Example

>>> read_json("path/to/json.json")
{"A": 1, "B": 2}
>>>
>>> hash_file_content(str(file_content))
"d3fad5bdf9"