






"""simple docstring"""
A_     :					Any							=     {hex(i)[2:]: i for i in range(16)}  # Use [:2] to strip off the leading '0x'






def 			lowerCamelCase_    (		_lowerCamelCase							):
 lowerCamelCase__	:     str								=		hex_string.strip().lower()
 if not hex_string:
  raise ValueError('Empty string was passed to the function'							)
 lowerCamelCase__	:     List[Any]								=		hex_string[0] == '-'
 if is_negative:
  lowerCamelCase__	:     Any								=		hex_string[1:]
 if not all(char in hex_table for char in hex_string							):
  raise ValueError('Non-hexadecimal value was passed to the function'							)
 lowerCamelCase__	:     Optional[Any]								=		0
 for char in hex_string:
  lowerCamelCase__	:     Union[str, Any]								=		16 * decimal_number + hex_table[char]
 return -decimal_number if is_negative else decimal_number


if __name__ == "__main__":
      from doctest import testmod

      testmod()









"""simple docstring"""
from __future__ import annotations






def 			lowerCamelCase_    (		_lowerCamelCase							):
 lowerCamelCase__	:     int
 lowerCamelCase__	:     list[str]								=		list(_lowerCamelCase							)
 lowerCamelCase__							,	lowerCamelCase__	:     Union[str, Any]								=		_vector[:-1], int(_vector[-1]							)
 lowerCamelCase__	:     list[int]								=		[int(_lowerCamelCase							) for digit in __vector]

 vector.reverse()
 for i, digit in enumerate(_lowerCamelCase							):
  if i & 1 == 0:
   lowerCamelCase__	:     int								=		digit * 2
   if doubled > 9:
    doubled -= 9
   check_digit += doubled
  else:
   check_digit += digit

 return check_digit % 10 == 0


if __name__ == "__main__":
      import doctest

      doctest.testmod()
      assert is_luhn("79927398713")
      assert not is_luhn("79927398714")

