uhashlib – hashing algorithms

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:

  • 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.

Hardware accelerate is enabled on K210.

1. Constructors

2. class uhashlib.sha256([data])

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

3. Methods

3.1. hash.update(data)

Feed more binary data into hash.

3.2. 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.

3.3. hash.hexdigest()

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

powered by GitbookFile Modify: 2021-02-03 10:26:57

results matching ""

    No results matching ""