Skip to main content

akit

English | 中文

Crockford base32 编解码,字母表里没有 I、L、O、U。

安装

pip install akit

用法

from akit import decode, encode

encode(b"\x00")              # '80'
encode(b"ÿ")              # 'FZ'
decode("FZ")                 # b'ÿ'
decode("fz")                 # b'ÿ'  大小写不敏感
decode("F-Z")                # b'ÿ'  分隔符忽略
decode("8O")                 # b'\x00'  O 读作零
decode(encode(b"\x00")) == b"\x00"   # True

说明

比 hex 更紧凑,且去掉了易混字母,人工念读不会听错。解码时 I/L 读作 1、O 读作 0,-、_、空格直接忽略。编码前会加一个 0x01 哨兵字节,否则前导零字节会被整数转换吃掉,往返变短。

许可证

MIT


English

Crockford base32 encoding: no I, L, O or U to confuse.

Install

pip install akit

Usage

from akit import decode, encode

encode(b"\x00")              # '80'
encode(b"ÿ")              # 'FZ'
decode("FZ")                 # b'ÿ'
decode("fz")                 # b'ÿ'  大小写不敏感
decode("F-Z")                # b'ÿ'  分隔符忽略
decode("8O")                 # b'\x00'  O 读作零
decode(encode(b"\x00")) == b"\x00"   # True

Notes

Denser than hex and free of look-alike letters. Decoding reads I/L as 1 and O as 0, and ignores -, _ and spaces. A 0x01 sentinel byte is prepended before integer conversion — without it, leading zero bytes are lost and round trips come back short.

License

MIT

Metadata

Release files for akit 0.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for akit 0.0.4
File Size Uploaded Provenance Actions
akit-0.0.4.tar.gz 3.6 kB Without provenance Details for akit-0.0.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for akit 0.0.4
File Interpreter ABI Platform Actions
akit-0.0.4-py3-none-any.whl Python 3 none any Details for akit-0.0.4-py3-none-any.whl

Total release size: 7.6 kB

Release files / akit-0.0.4.tar.gz

Download URL akit-0.0.4.tar.gz
Size 3.6 kB
Tags Source
SHA-256 checksum
How to use checksums
365dd71ac8837b4833481b42e2e902c9f9e71277f884b0b229f1195d85fc6e62
BLAKE2b-256 checksum
How to use checksums
a6fa75f6b711cda3c809913faf9196562201e9e0b0737744e10d29e72a809e33
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.11

Release files / akit-0.0.4-py3-none-any.whl

Download URL akit-0.0.4-py3-none-any.whl
Size 4.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7ef359060694d77827179b0ba49f4b9f4448b94e4a077beb1c4ed07b2d6bc2f7
BLAKE2b-256 checksum
How to use checksums
308bade7bcb7452a219c134f8864c8c3651c63415cc33685bcdec6bf5c6f63b1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.11

Security for akit 0.0.4

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page