def hexstring2string(s):
    """convert hex representation of digest back to raw digest"""
    assert (len(s) % 2 == 0)
    if s.startswith("0x") or s.startswith("0X"):
	s = s[2:]
    return "".join([chr(eval("0x%s" % s[i:i+2])) for i in range(0, len(s), 2)])
convert hex representation of digest back to raw digest
recipes/Python/299133_bubblebabble/recipe-299133.py