convert hex representation of digest back to raw digest
(s)
| 48 | return retval |
| 49 | |
| 50 | def hexstring2string(s): |
| 51 | """convert hex representation of digest back to raw digest""" |
| 52 | assert (len(s) % 2 == 0) |
| 53 | if s.startswith("0x") or s.startswith("0X"): |
| 54 | s = s[2:] |
| 55 | return "".join([chr(eval("0x%s" % s[i:i+2])) for i in range(0, len(s), 2)]) |
| 56 | |
| 57 | def _test(): |
| 58 | tests = """432cc46b5c67c9adaabdcc6c69e23d6d xibod-sycik-rilak-lydap-tipur-tifyk-sipuv-dazok-tixox |
no test coverage detected