1
0
Fork
You've already forked python
0

Allow custom alphabets for encoding #4

Merged
notpushkin merged 3 commits from feature/encoding-custom-alphabet into master 2026年04月18日 13:44:32 +02:00

Example:

from pretty_id.encoding import p32decode, p32encode
alphabet = "0123456789ABCDEFGHJKLMNPQRSTVWXY"
p32encode(b'hello!', alphabet=alphabet) # => 'D1JNQT3F44'
p32decode('D1JNQT3F44', alphabet=alphabet) # => b'hello!'

Not available with PrettyId yet, but useful if you want to implement something else.

Example: ```py from pretty_id.encoding import p32decode, p32encode alphabet = "0123456789ABCDEFGHJKLMNPQRSTVWXY" p32encode(b'hello!', alphabet=alphabet) # => 'D1JNQT3F44' p32decode('D1JNQT3F44', alphabet=alphabet) # => b'hello!' ``` Not available with `PrettyId` yet, but useful if you want to implement something else.
notpushkin force-pushed feature/encoding-custom-alphabet from f3d24aca95
Some checks failed
Publish / run (pull_request) Has been cancelled
to 4e5c88ee5b
All checks were successful
Publish / run (pull_request) Successful in 1m25s
2026年04月18日 13:41:45 +02:00
Compare
0.3.6
Some checks failed
Publish / run (pull_request) Has been cancelled
9ac38445f8
notpushkin deleted branch feature/encoding-custom-alphabet 2026年04月18日 13:44:33 +02:00
Sign in to join this conversation.
No reviewers
Labels
Clear labels
No items
No labels
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
prettyid/python!4
Reference in a new issue
prettyid/python
No description provided.
Delete branch "feature/encoding-custom-alphabet"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?