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

Function base64pickle

lib/core/convert.py:42–64  ·  view source on GitHub ↗

Serializes (with pickle) and encodes to Base64 format supplied (binary) value >>> base64unpickle(base64pickle([1, 2, 3])) == [1, 2, 3] True

(value)

Source from the content-addressed store, hash-verified

40 from cgi import escape as htmlEscape
41
42def base64pickle(value):
43 """
44 Serializes (with pickle) and encodes to Base64 format supplied (binary) value
45
46 >>> base64unpickle(base64pickle([1, 2, 3])) == [1, 2, 3]
47 True
48 """
49
50 retVal = None
51
52 try:
53 retVal = encodeBase64(pickle.dumps(value, PICKLE_PROTOCOL), binary=False)
54 except:
55 warnMsg = "problem occurred while serializing "
56 warnMsg += "instance of a type '%s'" % type(value)
57 singleTimeWarnMessage(warnMsg)
58
59 try:
60 retVal = encodeBase64(pickle.dumps(value), binary=False)
61 except:
62 raise
63
64 return retVal
65
66def base64unpickle(value):
67 """

Callers 1

serializeObjectFunction · 0.90

Calls 2

encodeBase64Function · 0.85
singleTimeWarnMessageFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…