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
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for crockford32-1.0.2-cp310-cp310-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f1c7976f1c59d4546452b4a266b16d8c81dd7bc665d6033396326e4a4314cd26 |
|
MD5 | 122540a42b198f3887bed8dd98d2660d |
|
BLAKE2b-256 | 1bba0cb74b3bad7f3503f91dcafe750a676ab9bc4e36c79bb4bf9cb9b45124e3 |