Predefined character sets to be used with Nano ID
Project description
Alphabets and string functions designed to be used with Nano ID.
Installation
pip install nanoid-dictionary
Usage
Available alphabets and functions:
alphabet_std
human_alphabet
lookalikes
lowercase
numbers
prevent_misreadings(unsafe_chars, alphabet)
uppercase
prevent_misreadings(unsafe_chars, alphabet) accepts a string and removes all the characters that look similar by default. The function is also case-insensitive.
from nanoid_dictionary import *
alphabet_std # => _-0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
human_alphabet # => _-23456789abcdefghijkmnpqrstuvwxyzABCDEFGHIJKMNPQRSTUVWXYZ
lookalikes # => 1l0o
lowercase # => abcdefghijklmnopqrstuvwxyz
numbers # => 0123456789
prevent_misreadings(lookalikes, 'a1l0o') # => a
uppercase # => ABCDEFGHIJKLMNOPQRSTUVWXYZ
Thanks to
Andrey Sitnik for Nano ID.
Aleksandr Zhuravlev for incredible Nano ID calculator.
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 Distribution
Built Distribution
Close
Hashes for nanoid_dictionary-2.4.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ca493cfdb9832c98554459e2a765510cc0f2f83d8abd366a9bdad1cf44492db1 |
|
MD5 | 108dcaef114fc23426bcaca1163139d4 |
|
BLAKE2b-256 | 85fc810e15be37c4bf383eb33bec12b35bcc08be518e6420e45d8b26b907f396 |