Function custom_base
from raimad.helpers
def custom_base(value: int, glyphs: list[str]) -> str
Encode an integer into base-N using a custom set of glyphs.
Parameters
----------
value: int
The integer to encode
glyphs: list[str]
A list of N strings representing the glyphs
in your custom base.
TODO low to high or high to low? I forgot.
Returns
-------
str
A string with your encoded integer.
Click to show code
def custom_base(value: int, glyphs: list[str]) -> str:
"""
Encode an integer into base-N using a custom set of glyphs.
Parameters
----------
value: int
The integer to encode
glyphs: list[str]
A list of N strings representing the glyphs
in your custom base.
TODO low to high or high to low? I forgot.
Returns
-------
str
A string with your encoded integer.
"""
return ''.join(_custom_base(value, glyphs))