hashlib -- Hashing algorithms. ============================== .. This document was autogenerated by Sphinx-autoapi from a .pyi stub or a source code file. .. Do not edit this file, instead edit the source file and run Sphinx to update. .. Source: docs/stubs/hashlib/__init__.pyi .. py:module:: hashlib .. autoapi-nested-parse:: Hashing algorithms. |see_cpython_module| :mod:`python:hashlib`. This module implements binary data hashing algorithms. The exact inventory of available algorithms depends on a board. Among the algorithms which may be implemented: * SHA256 - The current generation, modern hashing algorithm (of SHA2 series). It is suitable for cryptographically-secure purposes. Included in the MicroPython core and any board is recommended to provide this, unless it has particular code size constraints. * SHA1 - A previous generation algorithm. Not recommended for new usages, but SHA1 is a part of number of Internet standards and existing applications, so boards targeting network connectivity and interoperability will try to provide this. * MD5 - A legacy algorithm, not considered cryptographically secure. Only selected boards, targeting interoperability with legacy applications, will offer this. Classes ------- .. autoapisummary:: hashlib.hash hashlib.md5 hashlib.sha1 hashlib.sha256 Module Contents --------------- .. py:class:: hash .. py:method:: digest() -> bytes Return hash for all data passed through hash, as a bytes object. After this method is called, more data cannot be fed into the hash any longer. .. py:method:: hexdigest() -> _typeshed.Incomplete This method is NOT implemented. Use ``binascii.hexlify(hash.digest())`` to achieve a similar effect. .. py:method:: update(data) -> _typeshed.Incomplete Feed more binary data into hash. .. py:class:: md5(data: Optional[Any] = None) Create an MD5 hasher object and optionally feed ``data`` into it. .. py:class:: sha1(data: Optional[Any] = None) Create an SHA1 hasher object and optionally feed ``data`` into it. .. py:class:: sha256(data: Optional[Any] = None) Create an SHA256 hasher object and optionally feed ``data`` into it.