| |
- builtins.object
-
- LatinUtilities
class LatinUtilities(builtins.object) |
|
This class show int, hexa, binary and latin1 from int, hexa, binary or latin1.
>>> a = LatinUtilities()
>>> a.from_string("abc")
('abc', [97, 98, 99], '61 62 63', ['1100001', '1100010', '1100011'])
>>> str(a)
'TEXT: abc\nINT: 97 98 99\nHEXA: 61 62 63\nBINARY: 1100001 1100010 1100011'
>>> print(a)
TEXT: abc
INT: 97 98 99
HEXA: 61 62 63
BINARY: 1100001 1100010 1100011 |
|
Methods defined here:
- __init__(self)
- Initialize self. See help(type(self)) for accurate signature.
- __str__(self) -> str
- Return str(self).
- from_bin(self, binary: str) -> Tuple[str, List[int], str, List[str]]
- Get string, hexa, and int from binary.
- format accepted: "1100001 1100010 1100011"
>>> a = LatinUtilities()
>>> a.from_bin('1100001 1100010 1100011')
('abc', [97, 98, 99], '61 62 63', ['1100001', '1100010', '1100011'])
- from_bytes(self, encoded: bytes) -> Tuple[str, List[int], str, List[str]]
- Get string, hexa, int and binary from bytes.
>>> a = LatinUtilities()
>>> a.from_bytes(b'abc')
('abc', [97, 98, 99], '61 62 63', ['1100001', '1100010', '1100011'])
- from_hexa(self, hexa: str) -> Tuple[str, List[int], str, List[str]]
- Get string, int and binary from hexa.
- formats accepted: "a1 b4 ff", "A1B4FF" and "A1-b4-Ff"
>>> a = LatinUtilities()
>>> a.from_hexa('61 62 63')
('abc', [97, 98, 99], '61 62 63', ['1100001', '1100010', '1100011'])
>>> a.from_hexa('61:62:63')
('abc', [97, 98, 99], '61 62 63', ['1100001', '1100010', '1100011'])
>>> a.from_hexa('61-62-63')
('abc', [97, 98, 99], '61 62 63', ['1100001', '1100010', '1100011'])
>>> a.from_hexa('616263')
('abc', [97, 98, 99], '61 62 63', ['1100001', '1100010', '1100011'])
>>> a.from_hexa("5e 6F4f")
('^oO', [94, 111, 79], '5e 6f 4f', ['1011110', '1101111', '1001111'])
- from_int(self, numbers: list) -> Tuple[str, List[int], str, List[str]]
- Get string, hexa and binary from list of int.
>>> a = LatinUtilities()
>>> a.from_int([97, 98, 99])
('abc', [97, 98, 99], '61 62 63', ['1100001', '1100010', '1100011'])
- from_string(self, text: str) -> Tuple[str, List[int], str, List[str]]
- Get int, hexa and binary from string.
>>> a = LatinUtilities()
>>> a.from_string("abc")
('abc', [97, 98, 99], '61 62 63', ['1100001', '1100010', '1100011'])
Data descriptors defined here:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
| |