An implementation of Crockford's Base32 encoding for resource identifiers
Project description
Description
An implementation of Crockford's Base32 encoding, including checksums. Intended for use on unique resource identifiers in APIs. Does not apply automatic conversions on decode input as described in "API Design Patterns" by JJ Geewax p.92.
Created using pybind11 and setuptools.
Usage
encode(string input [, checksum = False])
import crockford32 as cr32
encode_input_one = "Hello"
encode_input_two = "Tree"
a = cr32.encode(encode_input_one)
b = cr32.encode(encode_input_two, True)
decode(string input [, checksum = False])
throws ValueError - invalid input characters
throws ValueError - invalid checksum (requires checksum=True)
import crockford32 as cr32
decode_input_one = "91JPRV3F"
decode_input_two = "AHS6AS8U"
try:
a = cr32.decode(decode_input_one)
except ValueError:
pass
try:
b = cr32.decode(decode_input_two, True)
except ValueError:
pass
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 Distribution
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 crockford32-1.0.2-cp310-cp310-manylinux_2_12_x86_64.manylinux2010_x86_64.whl.
File metadata
- Download URL: crockford32-1.0.2-cp310-cp310-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
- Upload date:
- Size: 89.1 kB
- Tags: CPython 3.10, manylinux: glibc 2.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 colorama/0.4.4 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.25.1 rfc3986/1.5.0 tqdm/4.57.0 urllib3/1.26.5 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f1c7976f1c59d4546452b4a266b16d8c81dd7bc665d6033396326e4a4314cd26
|
|
| MD5 |
122540a42b198f3887bed8dd98d2660d
|
|
| BLAKE2b-256 |
1bba0cb74b3bad7f3503f91dcafe750a676ab9bc4e36c79bb4bf9cb9b45124e3
|