def _strToHexBinary(v):
    """Test (and convert) hexa integer values. The number of characters should be even.
    @param v: the literal string defined as a hexa number
    @return long value
    @raise ValueError: invalid value
    """
    length = len(v)
    if length / 2 * 2 != length:
        raise ValueError('Invalid hex binary number %s' % v)
    return int(v, 16)
