'Convert an IPv6 hextet string into an integer.
Args:
hextet_str: A string, the number to parse.
Returns:
The hextet as an integer.
Raises:
ValueError: if the input isn\'t strictly a hex number from [0..FFFF].'

def _parse_hextet(self, hextet_str):

    if (not self._HEX_DIGITS.issuperset(hextet_str)):
        raise ValueError
    if (len(hextet_str) > 4):
        raise ValueError
    hextet_int = int(hextet_str, 16)
    if (hextet_int > 65535):
        raise ValueError
    return hextet_int
