From 2955ada22f5d12a7b4cb9c1881ad71bb7bfe1fa4 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 6 May 2018 12:23:21 -0500 Subject: docs: fix references to uhashlib --- docs/library/hashlib.rst | 59 +++++++++++++++++++++++++++++++++++++++++++++++ docs/library/index.rst | 2 +- docs/library/uhashlib.rst | 59 ----------------------------------------------- 3 files changed, 60 insertions(+), 60 deletions(-) create mode 100644 docs/library/hashlib.rst delete mode 100644 docs/library/uhashlib.rst (limited to 'docs') diff --git a/docs/library/hashlib.rst b/docs/library/hashlib.rst new file mode 100644 index 000000000..0205d5e6a --- /dev/null +++ b/docs/library/hashlib.rst @@ -0,0 +1,59 @@ +:mod:`hashlib` -- hashing algorithms +===================================== + +.. include:: ../templates/unsupported_in_circuitpython.inc + +.. module:: hashlib + :synopsis: hashing algorithms + +|see_cpython_module| :mod:`cpython: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 + interoperatiability will try to provide this. + +* MD5 - A legacy algorithm, not considered cryptographically secure. Only + selected boards, targeting interoperatibility with legacy applications, + will offer this. + +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 +------- + +.. 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 ``binascii.hexlify(hash.digest())`` + to achieve a similar effect. diff --git a/docs/library/index.rst b/docs/library/index.rst index 804bff93c..466068640 100644 --- a/docs/library/index.rst +++ b/docs/library/index.rst @@ -23,7 +23,7 @@ Python standard libraries and micro-libraries binascii.rst ucollections.rst uerrno.rst - uhashlib.rst + hashlib.rst uheapq.rst uio.rst ujson.rst diff --git a/docs/library/uhashlib.rst b/docs/library/uhashlib.rst deleted file mode 100644 index d0a3422a2..000000000 --- a/docs/library/uhashlib.rst +++ /dev/null @@ -1,59 +0,0 @@ -:mod:`uhashlib` -- hashing algorithms -===================================== - -.. include:: ../templates/unsupported_in_circuitpython.inc - -.. module:: uhashlib - :synopsis: hashing algorithms - -|see_cpython_module| :mod:`cpython: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 - interoperatiability will try to provide this. - -* MD5 - A legacy algorithm, not considered cryptographically secure. Only - selected boards, targeting interoperatibility with legacy applications, - will offer this. - -Constructors ------------- - -.. class:: uhashlib.sha256([data]) - - Create an SHA256 hasher object and optionally feed ``data`` into it. - -.. class:: uhashlib.sha1([data]) - - Create an SHA1 hasher object and optionally feed ``data`` into it. - -.. class:: uhashlib.md5([data]) - - 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 ``binascii.hexlify(hash.digest())`` - to achieve a similar effect. -- cgit v1.2.3