Commit f4d1d848 authored by Aurel's avatar Aurel

add the inverse method of dump


git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@449 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent c1e9eb56
......@@ -29,6 +29,17 @@ def dump(s):
return repr(s)
def bin(s):
"""Inverse of dump method."""
ret = []
while len(s):
print "%d" %int(s[:2], 16)
ret.append(chr(int(s[:2], 16)))
print ret
s = s[2:]
return ''.join(ret)
def makeChecksum(s):
"""Return a 4-byte integer checksum against a string."""
return adler32(s) & 0xffffffff
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment