utils

The junk drawer my dogs

mio.utils.hash_file(path: Path | str) str

Return the sha256 hash of a file

Parameters:
  • path (pathlib.Path) – File to hash

  • hash (str) – Hash algorithm to use

Returns:

Hash of file

Return type:

str

References

https://stackoverflow.com/a/44873382

mio.utils.hash_video(path: Path | str, method: str = 'blake2s') str

Create a hash of a video by digesting the byte string each of its decoded frames.

Intended to remove variability in video encodings across platforms.

Parameters:
Returns:

str