hashlib – hashing algorithms — MicroPython latest documentation (original) (raw)

This is the documentation for the latest development branch of MicroPython and may refer to features that are not available in released versions.

If you are looking for the documentation for a specific release, use the drop-down menu on the left and select the desired version.

This module implements a subset of the corresponding CPython module, as described below. For more information, refer to the original CPython documentation: 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:

Constructors

class hashlib.sha256([_data_])

Create an SHA256 hasher object and optionally feed data into it.

class hashlib.sha1([_data_])

Create an SHA1 hasher object and optionally feed data into it.

class hashlib.md5([_data_])

Create an MD5 hasher object and optionally feed data into it.

Methods

hash.update(data)

Feed more binary data into hash.

hash.digest()

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.

hash.hexdigest()

This method is NOT implemented. Use binascii.hexlify(hash.digest())to achieve a similar effect.