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.3

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.3
File Size Uploaded Provenance Actions
akit-0.0.3.tar.gz 3.6 kB Without provenance Details for akit-0.0.3.tar.gz

Built distribution (wheel)

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

Total release size: 7.6 kB

Release files / akit-0.0.3.tar.gz

Download URL akit-0.0.3.tar.gz
Size 3.6 kB
Tags Source
SHA-256 checksum
How to use checksums
45f1d15beb453da262d31889ad1011ede4d1311f44324317268c35141b1b30c7
BLAKE2b-256 checksum
How to use checksums
be42c6e59716d1f251c70f77f3514641be48298e387cfe29df379852137d0019
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.3-py3-none-any.whl

Download URL akit-0.0.3-py3-none-any.whl
Size 4.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5fa755a5c03c2bd90cc82e25de086593a80abd89c62f592d7e1a66bc05d479ce
BLAKE2b-256 checksum
How to use checksums
1626512b154b4d103064b4e008f81b3d5ca465caf0dac9179b2a50b2c3ee420f
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.3

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