MCPcopy Index your code
hub / github.com/sqlmapproject/sqlmap / encodeHex

Function encodeHex

lib/core/convert.py:169–197  ·  view source on GitHub ↗

Returns an encoded representation of the provided value >>> encodeHex(b"123") == b"313233" True >>> encodeHex("123", binary=False) '313233' >>> encodeHex(b"123"[0]) == b"31" True >>> encodeHex(123, binary=False) '7b'

(value, binary=True)

Source from the content-addressed store, hash-verified

167 return retVal
168
169def encodeHex(value, binary=True):
170 """
171 Returns an encoded representation of the provided value
172
173 >>> encodeHex(b"123") == b"313233"
174 True
175 >>> encodeHex("123", binary=False)
176 '313233'
177 >>> encodeHex(b"123"[0]) == b"31"
178 True
179 >>> encodeHex(123, binary=False)
180 '7b'
181 """
182
183 if isinstance(value, int):
184 value = six.int2byte(value)
185
186 if isinstance(value, six.text_type):
187 value = value.encode(UNICODE_ENCODING)
188
189 try:
190 retVal = codecs.encode(value, "hex")
191 except LookupError:
192 retVal = binascii.hexlify(value)
193
194 if not binary:
195 retVal = getText(retVal)
196
197 return retVal
198
199def decodeBase64(value, binary=True, encoding=None):
200 """

Callers 10

oracle_old_passwdFunction · 0.90
attackDumpedTableFunction · 0.90
dictionaryAttackFunction · 0.90
task_newFunction · 0.90
serverFunction · 0.90
xpCmdshellForgeCmdMethod · 0.90
_webFileInjectMethod · 0.90
fileContentEncodeMethod · 0.90
getPasswordHashesMethod · 0.90
_dataToScrMethod · 0.90

Calls 1

getTextFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…