Secure hashes and message digests
Project description
Introduction
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 supported by the CircuitPython module.
This library is based on the work performed in the micropython-lib hashlib module by Paul Sokolovsky
Dependencies
This driver depends on:
Please ensure all dependencies are available on the CircuitPython filesystem. This is easily achieved by downloading the Adafruit library and driver bundle.
Installing from PyPI
On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally from PyPI. To install for current user:
pip3 install adafruit-circuitpython-hashlib
To install system-wide (this may be required in some cases):
sudo pip3 install adafruit-circuitpython-hashlib
To install in a virtual environment in your current project:
mkdir project-name && cd project-name
python3 -m venv .env
source .env/bin/activate
pip3 install adafruit-circuitpython-hashlib
Usage Example
import adafruit_hashlib as hashlib
m = hashlib.sha256()
m.update(b"CircuitPython")
print("Msg Hex Digest: {}\nMsg Digest Size: {}\nMsg Block Size: {}".format(
m.hexdigest(), m.digest_size, m.block_size))
Contributing
Contributions are welcome! Please read our Code of Conduct before contributing to help this project stay welcoming.
Documentation
For information on building library documentation, please check out this guide.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file adafruit-circuitpython-hashlib-1.3.5.tar.gz
.
File metadata
- Download URL: adafruit-circuitpython-hashlib-1.3.5.tar.gz
- Upload date:
- Size: 33.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 75f27a32b69c60494d6c51f7e6087324e57e135ffceaeb854be185daaef40907 |
|
MD5 | 99f8e6e032c1d75230aefea5401b5d75 |
|
BLAKE2b-256 | 543a53e642ee1795fecbefffdef3c362991798a730bbd22326f59f05c310c3f9 |