def hex2str(value):
    if len(value) % 2 != 0:
        raise Exception("hex2str got value %r" % value)
    r = ''
    for i in range(old_div(len(value), 2)):
        s = value[i * 2:i * 2 + 2]
        h = int(s, 16)
        r += chr(h)
    return r

# http://snippets.dzone.com/posts/show/2375
Convert the hexadecimal representation of a string to the original string.
dataset/ETHPy150Open lsaffre/lino/lino/utils/__init__.py/hex2str