Initial Code! #1
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This module implements a common interface to many different secure hash and message digest algorithms. Included are the FIPS secure hash algorithms SHA1, SHA224, SHA256, SHA384, and SHA512 (defined in FIPS 180-2) as well as RSA’s MD5 algorithm (defined in Internet RFC 1321).
SHA1 and MD5 algorithms are not currently supported by the CircuitPython module, but constructors/sub-modules are included in the library to retain backwards-compatibility with the CPython3
hashlib
module's available algorithms.This library is based on the work performed in the micropython-lib hashlib module by Paul Sokolovsky. I refactored
__init__.py
to expose the available algorithms (accessible by calling thealgorithms_available
constructor, mimicking CPython), added classes for SHA1/MD5, comments and linting performed in all the algorithm sub-modules, exposed submodule classname
("suitable as a parameter to new() to create another hash of this type", same as CPython). The unittest-like tests within _sha256.py and _sha512.py have been removed to save space.ReadTheDocs for this module has been created (https://circuitpython.readthedocs.io/projects/hashlib/en/latest) and will be online post-merge.