Fast cryptographic functions (SHA-256, MD5, HMAC, Base64/32, CRC32) powered by BMB
Project description
bmb-crypto — Fast Cryptographic Functions
Standards-compliant hashing, encoding, and checksums compiled from BMB.
Installation
pip install bmb-crypto
Quick Start
import bmb_crypto
bmb_crypto.sha256("hello")
# '2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824'
bmb_crypto.md5("hello")
# '5d41402abc4b2a76b9719d911017c592'
bmb_crypto.hmac_sha256("key", "message")
# RFC 2104 compliant HMAC-SHA256
bmb_crypto.base64_encode("hello") # 'aGVsbG8='
bmb_crypto.base64_decode("aGVsbG8=") # 'hello'
bmb_crypto.crc32("hello") # '3610a686'
bmb_crypto.adler32("Wikipedia") # '11e60398'
Full API (14 functions)
| Function | Standard | Output |
|---|---|---|
sha256(data) |
FIPS 180-4 | 64-char hex |
md5(data) |
RFC 1321 | 32-char hex |
crc32(data) |
ISO 3309 | 8-char hex |
hmac_sha256(key, msg) |
RFC 2104 | 64-char hex |
base64_encode(data) |
RFC 4648 | Base64 string |
base64_decode(data) |
RFC 4648 | Original string |
base32_encode(data) |
RFC 4648 | Base32 string |
base32_decode(data) |
RFC 4648 | Original string |
adler32(data) |
RFC 1950 | 8-char hex |
fletcher16(data) |
Fletcher-16 | 4-char hex |
xor_checksum(data) |
XOR | 2-char hex |
rot13(data) |
ROT13 | Transformed string |
hex_encode(data) |
Hex | Hex string |
hex_decode(data) |
Hex | Original string |
All outputs cross-validated against Python's hashlib, binascii, hmac, and base64.
How?
Written in BMB — compile-time contracts prove correctness, then generate code faster than hand-tuned C.
License
MIT
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 Distributions
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bmb_crypto-0.3.0-py3-none-win_amd64.whl.
File metadata
- Download URL: bmb_crypto-0.3.0-py3-none-win_amd64.whl
- Upload date:
- Size: 95.4 kB
- Tags: Python 3, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9125a9eef1f6e3f922bfd934e3988562919fb5cfd57539bcdb4c34ead06071ea
|
|
| MD5 |
cc0d03d3bb297bc210189cc1be7dc4a6
|
|
| BLAKE2b-256 |
8618c4aaa3fa6a76f671261ab1823f70b751491c9d2abc34214502218ab53f1f
|
File details
Details for the file bmb_crypto-0.3.0-py3-none-manylinux_2_17_x86_64.whl.
File metadata
- Download URL: bmb_crypto-0.3.0-py3-none-manylinux_2_17_x86_64.whl
- Upload date:
- Size: 82.6 kB
- Tags: Python 3, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ef804ff194c5aea1b6f0d4b78782e923ae512e9062b8a6de7048eeab93960371
|
|
| MD5 |
1d2657b1e6b3f296bce587a5ee468e11
|
|
| BLAKE2b-256 |
b0e388e12a84c924c10c2cf14f5cae5b04768f6b445d314b2acbce6a99cea6f4
|
File details
Details for the file bmb_crypto-0.3.0-py3-none-macosx_15_0_universal2.whl.
File metadata
- Download URL: bmb_crypto-0.3.0-py3-none-macosx_15_0_universal2.whl
- Upload date:
- Size: 60.3 kB
- Tags: Python 3, macOS 15.0+ universal2 (ARM64, x86-64)
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
34f1d2d105f60d03a1b4c715b9e99d80b0b4579fca4d77e7aacc2b906483e0b4
|
|
| MD5 |
a869463ae8321506684cf0e95d3453e8
|
|
| BLAKE2b-256 |
baf89f9bcf109bad6a10ce244dc149db07a9c6af9c059da3d6151f1b962f9f13
|