Validate that value has hex format.

def validate_hex(value):
    """Validate that value has hex format."""
    try:
        binascii.unhexlify(value)
    except Exception:
        raise vol.Invalid(
            '{} is not of hex format'.format(value))
    return value