hash
====

.. py:module:: hash


Classes
-------

.. autoapisummary::

   hash.HashError


Functions
---------

.. autoapisummary::

   hash.__compute_hash
   hash.md5
   hash.sha1
   hash.sha256
   hash.sha512


Module Contents
---------------

.. py:class:: HashError

   Bases: :py:obj:`e3.error.E3Error`


.. py:function:: __compute_hash(path: os.PathLike[str] | str, kind: Literal['md5'] | Literal['sha1'] | Literal['sha256'] | Literal['sha512']) -> str

.. py:function:: md5(path: os.PathLike[str] | str) -> str

   Compute md5 hexadecimal digest of a file.

   :param path: path to a file

   :return: the hash of the file content
   :raise HashError: in case of error


.. py:function:: sha1(path: os.PathLike[str] | str) -> str

   Compute sha1 hexadecimal digest of a file.

   :param str path: path to a file

   :return: the hash of the file content
   :raise HashError: in case of error


.. py:function:: sha256(path: os.PathLike[str] | str) -> str

   Compute sha256 hexadecimal digest of a file.

   :param str path: path to a file

   :return: the hash of the file content
   :raise HashError: in case of error


.. py:function:: sha512(path: os.PathLike[str] | str) -> str

   Compute sha512 hexadecimal digest of a file.

   :param str path: path to a file

   :return: the hash of the file content
   :raise HashError: in case of error


