Ë
    Ã?Æij
  ã                  óN   — d Z ddlmZ ddl­ ddlmZmZ d
d„Zd
d„Zd
d„Z	dd„Z
y	)aA  RTN (Routing transport number).

The routing transport number is a nine digit number used in the US banking
system for processing deposits between banks.

The last digit is a checksum.

>>> calc_check_digit('11100002')
'5'
>>> validate('111000025')
'111000025'
>>> validate('11100002')  # Not nine digits
Traceback (most recent call last):
    ...
InvalidLength: ..
>>> validate('11100002B')  # Not all numeric
Traceback (most recent call last):
    ...
InvalidFormat: ..
>>> validate('112000025')  # bad checksum
Traceback (most recent call last):
    ...
InvalidChecksum: ..
é    )Úannotations)Ú*)ÚcleanÚisdigitsc                ó8   — t        | «      j                  «       } | S )zkConvert the number to the minimal representation. This strips the
    number of any surrounding whitespace.)r   Ústrip©Únumbers    úT/var/www/html/myprovider/mon_projet_qr/lib/python3.12/site-packages/stdnum/us/rtn.pyÚcompactr   3   s   € ô �6‹]× Ñ Ó"€FØ€Mó    c                óÈ   — | D �cg c]  }t        |«      ‘Œ }}d|d   |d   z   |d   z   z  d|d   |d   z   |d   z   z  z   d|d   |d	   z   z  z   d
z  }t        |«      S c c}w )zZCalculate the check digit. The number passed should not have the
    check digit included.é   r   é   é   é   é   é	   é   é   é
   )ÚintÚstr)r
   ÚcÚdigitsÚchecksums       r   Úcalc_check_digitr   :   s“   € ð %Ö%˜Œc�!�fÐ%€FÐ%à	ˆV�A‰Y˜ ™Ñ" V¨A¡YÑ.Ñ/Ø	ˆV�A‰Y˜ ™Ñ" V¨A¡YÑ.Ñ/ñ	0à	ˆV�A‰Y˜ ™Ñ"Ñ#ñ	$ð 	ñ	€Hô
 ˆx‹=Ðùò &s   …Ac                ó²   — t        | «      } t        | «      s
t        «       ‚t        | «      dk7  r
t	        «       ‚t        | dd «      | d   k7  r
t        «       ‚| S )zZCheck if the number is a valid routing number. This checks the length
    and check digit.r   Néÿÿÿÿ)r   r   ÚInvalidFormatÚlenÚInvalidLengthr   ÚInvalidChecksumr	   s    r   Úvalidater$   F   sV   € ô �V‹_€FÜ�FÔÜ‹oÐÜ
ˆ6ƒ{�aÒÜ‹oÐÜ˜˜s ˜Ó$¨¨r©
Ò2ÜÓÐØ€Mr   c                óJ   — 	 t        t        | «      «      S # t        $ r Y yw xY w)z#Check if the number is a valid RTN.F)Úboolr$   ÚValidationErrorr	   s    r   Úis_validr(   S   s)   € ðÜ”H˜VÓ$Ó%Ð%øÜò Ùðús   ‚ –	"¡"N)r
   r   Úreturnr   )r
   r   r)   r&   )Ú__doc__Ú
__future__r   Ústdnum.exceptionsÚstdnum.utilr   r   r   r   r$   r(   © r   r   ú<module>r/      s)   ðñ(õ2 #ä ß 'óó	ó
ôr   