6 Star 12 Fork 11

QuecPython/microPython

Create your Gitee Account
Explore and code with more than 14 million developers,Free private repositories !:)
Sign up
文件
Clone or Download
uhashlib.rst 1.79 KB
Copy Edit Raw Blame History
chenchi authored 2021-06-03 16:44 +08:00 . first commit

:mod:`uhashlib` -- hashing algorithms

.. module:: uhashlib
   :synopsis: 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.

Constructors

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

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

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

Methods

.. method:: hash.update(data)

   Feed more binary data into hash.

.. method:: 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.

.. method:: hash.hexdigest()

   This method is NOT implemented. Use ``ubinascii.hexlify(hash.digest())``
   to achieve a similar effect.
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/quecpython/microPython.git
git@gitee.com:quecpython/microPython.git
quecpython
microPython
microPython
master

Search