smol ids A simple function that produces a reverseable alphabet-encoding for integers. It excludes easily visually confused characters such as iIl1 and O0.
Go to file
Charles Aylward 02f73ff18a Add LICENSE, or lack thereof 2023-11-25 18:08:12 -08:00
.gitignore Why would you even post this anywhere? 2023-11-25 17:58:31 -08:00
LICENSE Add LICENSE, or lack thereof 2023-11-25 18:08:12 -08:00
README.md Why would you even post this anywhere? 2023-11-25 17:58:31 -08:00
example.py Why would you even post this anywhere? 2023-11-25 17:58:31 -08:00
smidge.py Why would you even post this anywhere? 2023-11-25 17:58:31 -08:00

README.md

SMIDGE

A simple function to encode an integer into a large-radix alphabet-encoded string. The alphabet omits easily visually confused characters such as Il1i and O0.

This piece of code was originally written in the early days of twttr (twitter) where you would send and receive text messages from 40404 and only had 140 characters to represent a large URL. You might also want to type the URL into a browser by reading it off of your flip phone, so it was important that the characters were unambiguous.

Basic Usage

from smidge import smid
from uuid import uuid4

print(smid(uuid4().int))

Result

; python3 example.py
FJ2SweD8htTWQQULtq5a4E