MCPcopy Create free account
hub / github.com/daniel2005d/mapXplore / decode

Method decode

utils/utils.py:126–141  ·  view source on GitHub ↗
(text:str)

Source from the content-addressed store, hash-verified

124
125 @staticmethod
126 def decode(text:str)->str:
127 decoded = text
128 try:
129 if text is None:
130 return None
131 if Util.isHexa(text):
132 text = repr(text)
133
134 if not text.isdigit():
135 decoded = text.encode('latin').decode('unicode_escape')
136 except Exception as e:
137 hex_values = [ord(c) for c in text]
138 ascii_values = [chr(v) for v in hex_values]
139 decoded = ''.join(c for c in ascii_values if len(c)==1)
140
141 return decoded
142
143class Hashing:
144 @staticmethod

Callers 3

isHexaMethod · 0.80
get_from_base64Method · 0.80
get_structureMethod · 0.80

Calls 1

isHexaMethod · 0.80

Tested by

no test coverage detected