%PDF- %PDF-
Direktori : /lib/python3/dist-packages/netaddr/ip/__pycache__/ |
Current File : //lib/python3/dist-packages/netaddr/ip/__pycache__/rfc1924.cpython-312.pyc |
� ӊ�^� � � � d Z ddlmZ ddlmZ ddlmZ d� Z edd� edd � z ed d� z g d�z Z e ee e dd � � � Zd� Zd� Z y)z&A basic implementation of RFC 1924 ;-)� )�AddrFormatError)� IPAddress)�_zipc �| � t t | � t |� dz � D �cg c] }t |� �� c}S c c}w )z2Returns all characters between low and high chars.� )�range�ord�chr)�low�high�is �4/usr/lib/python3/dist-packages/netaddr/ip/rfc1924.py� chr_ranger s- � �!�#�c�(�C��I��M�:�;�q�C��F�;�;��;s �9�0�9�A�Z�a�z)�!�#�$�%�&�(�)�*�+�-�;�<�=�>�?�@�^�_�`�{�|�}�~�V c � � t | � }t |� }g }|dkD r|j |dz � |dz }|dkD r�dj t |� D �cg c] }t | �� c}� }dt |� z dz }||z S c c}w )z*Convert a regular IPv6 address to base 85.r �U � � r )r �int�append�join�reversed�BASE_85�len)�addr�ip�int_val� remainder�w�encoded�leading_zeroess r �ipv6_to_base85r? s� � � �4��B��"�g�G��I� �A�+�����2��&��B��� �A�+� �g�g�8�I�+>�?�a�w�q�z�?�@�G��3�w�<�'�3�.�N��G�#�#�� @s �Bc �� � t | � }t |� dk7 rt d| ��� �d}t t |� � D ] \ }}t | }||d|z z z }� t |d� }t |� S )zC Convert a base 85 IPv6 address to its hexadecimal format. r1 zInvalid base 85 IPv6 address: r r/ � )�listr7 r � enumerater5 �BASE_85_DICTr �str)r8 �tokens�resultr �numr9 s r �base85_to_ipv6rI - s| � � �$�Z�F� �6�{�b���D�J�K�K� �F��H�V�,�-� "���3��3����3��q��=�!��"� �6�1� �B��r�7�N� N)�__doc__�netaddr.corer � netaddr.ipr �netaddr.compatr r r6 �dictr rD r? rI � rJ r �<module>rQ sq �� -� (� � �<� �c�3��)�C��-�-� �c�3���2�2� � �D��%��2�,�/�0��$�rJ