This class provides methods allowing conversion between integer, hexadecimal integer and base36 strings.
More...
This class provides methods allowing conversion between integer, hexadecimal integer and base36 strings.
Definition at line 46 of file base36.py.
◆ __init__()
def caellion.pycommons.encoding.base36.Base36Coder.__init__ |
( |
|
self, |
|
|
|
custom_charset = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ" |
|
) |
| |
Initialize coder.
- Parameters
-
custom_charset | custom character set to use with the coder |
- Exceptions
-
Definition at line 54 of file base36.py.
◆ b36_to_bytes()
def caellion.pycommons.encoding.base36.Base36Coder.b36_to_bytes |
( |
|
self, |
|
|
|
b36 |
|
) |
| |
Converts base36 string in custom encoding charset to bytes.
- Parameters
-
b36 | string in custom encoding charset |
- Returns
- decoded bytes
- Exceptions
-
Definition at line 171 of file base36.py.
◆ b36_to_int()
def caellion.pycommons.encoding.base36.Base36Coder.b36_to_int |
( |
|
self, |
|
|
|
b36 |
|
) |
| |
Converts base36 string in custom encoding charset to integer.
- Parameters
-
b36 | base36 string in custom encoding charset |
- Returns
- decoded integer
- Exceptions
-
Definition at line 196 of file base36.py.
◆ bytes_to_b36()
def caellion.pycommons.encoding.base36.Base36Coder.bytes_to_b36 |
( |
|
self, |
|
|
|
bytes_in |
|
) |
| |
Converts bytes to base36 string in custom charset encoding.
- Parameters
-
bytes_in | a bytes object to encode |
- Returns
- Base36 string in custom format
Definition at line 128 of file base36.py.
◆ int_to_b36()
def caellion.pycommons.encoding.base36.Base36Coder.int_to_b36 |
( |
|
self, |
|
|
|
integer |
|
) |
| |
Converts int to base36 string in custom charset encoding.
- Parameters
-
- Returns
- Base36 string in custom format
- Exceptions
-
Definition at line 147 of file base36.py.
◆ to_custom_charset()
def caellion.pycommons.encoding.base36.Base36Coder.to_custom_charset |
( |
|
self, |
|
|
|
unformatted |
|
) |
| |
Converts standard charset to custom charset.
- Parameters
-
unformatted | Base36 string in standard charset encoding |
- Returns
- Base36 string in custom format
- Exceptions
-
Definition at line 104 of file base36.py.
◆ to_standard_charset()
def caellion.pycommons.encoding.base36.Base36Coder.to_standard_charset |
( |
|
self, |
|
|
|
unformatted |
|
) |
| |
Converts custom charset to standard charset.
- Parameters
-
unformatted | Base36 string in custom charset encoding |
- Returns
- Base36 string in standardized format
- Exceptions
-
Definition at line 80 of file base36.py.
◆ custom_charset
caellion.pycommons.encoding.base36.Base36Coder.custom_charset = None |
|
static |
The documentation for this class was generated from the following file: