()
| 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 |
| 59 | 5a1edbe07020525fd28cba1ea3b76694 xikic-vikyv-besed-begyh-zagim-sevic-vomer-lunon-gexex |
| 60 | 1c453603cdc914c1f2eeb1abddae2e03 xelag-hatyb-fafes-nehys-cysyv-vasop-rylop-vorab-fuxux |
| 61 | df8ec33d78ae78280e10873f5e58d5ad xulom-vebyf-tevyp-vevid-mufic-bucef-zylyh-mehyp-tuxax |
| 62 | 02b682a73739a9fb062370eaa8bcaec9 xebir-kybyp-latif-napoz-ricid-fusiv-popir-soras-nixyx""" |
| 63 | # ...as computed by perl |
| 64 | |
| 65 | tests = [x.split()[:2] for x in tests.split("\n")] |
| 66 | for digest, expected in tests: |
| 67 | res=bubblebabble(hexstring2string(digest)) |
| 68 | print digest, res, ("failure", "ok")[expected==res] |
| 69 | |
| 70 | |
| 71 | if __name__=="__main__": |
no test coverage detected