diff options
Diffstat (limited to 'libmproxy/utils.py')
-rw-r--r-- | libmproxy/utils.py | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/libmproxy/utils.py b/libmproxy/utils.py index 69a06a26..6e804887 100644 --- a/libmproxy/utils.py +++ b/libmproxy/utils.py @@ -55,24 +55,6 @@ def isXML(s): return False -def cleanBin(s, fixspacing=False): - """ - Cleans binary data to make it safe to display. If fixspacing is True, - tabs, newlines and so forth will be maintained, if not, they will be - replaced with a placeholder. - """ - parts = [] - for i in s: - o = ord(i) - if (o > 31 and o < 127): - parts.append(i) - elif i in "\n\r\t" and not fixspacing: - parts.append(i) - else: - parts.append(".") - return "".join(parts) - - def pretty_json(s): try: p = json.loads(s) @@ -96,25 +78,6 @@ def urlencode(s): return urllib.urlencode(s, False) -def hexdump(s): - """ - Returns a set of typles: - (offset, hex, str) - """ - parts = [] - for i in range(0, len(s), 16): - o = "%.10x"%i - part = s[i:i+16] - x = " ".join("%.2x"%ord(i) for i in part) - if len(part) < 16: - x += " " - x += " ".join(" " for i in range(16 - len(part))) - parts.append( - (o, x, cleanBin(part, True)) - ) - return parts - - def del_all(dict, keys): for key in keys: if key in dict: |