File: //home/arjun/projects/env/lib/python3.10/site-packages/validators/__pycache__/iban.cpython-310.pyc
o
we^ � @ sJ d Z ddlZddlmZ defdd�Zdefd d
�Zedefdd��ZdS )
zIBAN.� N� )� validator�charc C s$ | � � r| S tdt| � td� �S )zA=10, B=11, ..., Z=35.�
�A)�isdigit�str�ord)r � r
�H/home/arjun/projects/env/lib/python3.10/site-packages/validators/iban.py�_char_value
s $r �valuec C s8 | dd� | dd� }t d�dd� |D ���d dkS )z0Check if the value string passes the mod97-test.� N� c s s � | ]}t |�V qd S )N)r )�.0r r
r
r � <genexpr> s � z_mod_check.<locals>.<genexpr>�a r )�int�join)r
�
rearrangedr
r
r �
_mod_check s r c C s | rt �d| �ot| �S dS )a� Return whether or not given value is a valid IBAN code.
Examples:
>>> iban('DE29100500001061045672')
# Output: True
>>> iban('123456')
# Output: ValidationError(func=iban, ...)
Args:
value:
IBAN string to validate.
Returns:
(Literal[True]):
If `value` is a valid IBAN code.
(ValidationError):
If `value` is an invalid IBAN code.
> *New in version 0.8.0*
z!^[A-Z]{2}[0-9]{2}[A-Z0-9]{11,30}$F)�re�matchr )r
r
r
r �iban s
���r )�__doc__r �utilsr r r r r r
r
r
r �<module> s