def is_hex_string(string):
  """Check if a string represents a hex value"""
  if not string.startswith("0x"):
    return False

  try:
    int(string, 16)
    return True
  except ValueError as _:
    return False