Hashbase
A Python package to compute the hash value of an input string using various cryptographic hashing algorithms.
Definition: A hash function is any function that can be used to map data of arbitrary size to fixed-size values (source).
📝 Table of Contents
🏁 Getting Started
To install the package directly from PyPi:
$ pip install hashbase
🎈 Usage
Check out: examples/hash.py
Import the required hash function(s)
from hashbase import (
MD2,
MD4,
MD5,
SHA1,
SHA224,
SHA256,
SHA384,
SHA512,
SHA512_224,
SHA512_256,
RIPEMD128,
RIPEMD160,
RIPEMD256,
RIPEMD320,
CRC8,
CRC16,
)
Generate the hash of the input string
message: str = "password"
print(f"MD2: {MD2().generate_hash(message)}")
print(f"MD4: {MD4().generate_hash(message)}")
print(f"MD5: {MD5().generate_hash(message)}")
print(f"SHA-1: {SHA1().generate_hash(message)}")
print(f"SHA-224: {SHA224().generate_hash(message)}")
print(f"SHA-256: {SHA256().generate_hash(message)}")
print(f"SHA-384: {SHA384().generate_hash(message)}")
print(f"SHA-512: {SHA512().generate_hash(message)}")
print(f"SHA-512/224: {SHA512_224().generate_hash(message)}")
print(f"SHA-512/256: {SHA512_256().generate_hash(message)}")
print(f"RIPEMD-128: {RIPEMD128().generate_hash(message)}")
print(f"RIPEMD-160: {RIPEMD160().generate_hash(message)}")
print(f"RIPEMD-256: {RIPEMD256().generate_hash(message)}")
print(f"RIPEMD-320: {RIPEMD320().generate_hash(message)}")
print(f"CRC-8: {CRC8().generate_hash(message)}")
print(f"CRC-16: {CRC16().generate_hash(message)}")
The output of the above cell
MD2: f03881a88c6e39135f0ecc60efd609b9
MD4: 8a9d093f14f8701df17732b2bb182c74
MD5: 5f4dcc3b5aa765d61d8327deb882cf99
SHA-1: 5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8
SHA-224: d63dc919e201d7bc4c825630d2cf25fdc93d4b2f0d46706d29038d01
SHA-256: 5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8
SHA-384: a8b64babd0aca91a59bdbb7761b421d4f2bb38280d3a75ba0f21f2bebc45583d446c598660c94ce680c47d19c30783a7
SHA-512: b109f3bbbc244eb82441917ed06d618b9008dd09b3befd1b5e07394c706a8bb980b1d7785e5976ec049b46df5f1326af5a2ea6d103fd07c95385ffab0cacbc86
SHA-512/224: f2356967afbae0c00f7a58d28a126fe034d555397d0d0772d1427c98
SHA-512/256: f3f22d82ccf54a92cfc584d9f1531cbf29b11b513f7f68a20a2fa707f3450220
RIPEMD-128: c9c6d316d6dc4d952a789fd4b8858ed7
RIPEMD-160: 2c08e8f5884750a7b99f6f2f342fc638db25ff31
RIPEMD-256: f94cf96c79103c3ccad10d308c02a1db73b986e2c48962e96ecd305e0b80ef1b
RIPEMD-320: c571d82e535de67ff5f87e417b3d53125f2d83ed7598b89d74483e6c0dfe8d86e88b380249fc8fb4
CRC-8: 0x4f
CRC-16: 0x7e5b
📦 Contents
Message-Digest (MD)
- MD2 (
hashbase.MD2) - MD4 (
hashbase.MD4) - MD5 (
hashbase.MD5)
Secure Hash Algorithm (SHA)
- SHA-1 (
hashbase.SHA1) - SHA-224 (
hashbase.SHA224) - SHA-256 (
hashbase.SHA256) - SHA-512 (
hashbase.SHA512) - SHA-512/224 (
hashbase.SHA512_224) - SHA-512/256 (
hashbase.SHA512_256) - SHA-384 (
hashbase.SHA384)
RIPE Message Digest (RIPEMD)
- RIPEMD-128 (
hashbase.RIPEMD128) - RIPEMD-160 (
hashbase.RIPEMD160) - RIPEMD-256 (
hashbase.RIPEMD256) - RIPEMD-320 (
hashbase.RIPEMD320)
Cyclic Redundancy Check (CRC)
- CRC-8 (
hashbase.CRC8) - CRC-16 (
hashbase.CRC16)
Contributing
- Post any issues and suggestions on the GitHub issues page.
- To contribute, fork the project and then create a pull request back to master.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Metadata
Release files for hashbase 1.1.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| hashbase-1.1.5.tar.gz | 16.3 kB | Without provenance | Details for hashbase-1.1.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| hashbase-1.1.5-py3-none-any.whl | Python 3 | none | any | Details for hashbase-1.1.5-py3-none-any.whl |
Total release size: 45.8 kB
Release files / hashbase-1.1.5.tar.gz
| Download URL | hashbase-1.1.5.tar.gz |
|---|---|
| Size | 16.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
34b5d791a8481cc0278444f93a90aed2637753ac464e7b21f81a706f9a581b2b
|
|
BLAKE2b-256 checksum How to use checksums |
1b7c456af65098be06c7cf4a9bc1ab333f65f24ef929356e64f8956161412371
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.14
|
Release files / hashbase-1.1.5-py3-none-any.whl
| Download URL | hashbase-1.1.5-py3-none-any.whl |
|---|---|
| Size | 29.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
78615d8aa4e89ccec42137ee03c1a71a03348c7141606227ae233bc1f566a16e
|
|
BLAKE2b-256 checksum How to use checksums |
2c96aa7773329e05168c59391103483250308cf2aefbfa83f5f93064880bdb33
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.14
|
Security for hashbase 1.1.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.