� <��g~��V�ddlmZddlZddlZddlZddlZddgZdZdd�Zdd �Z dd�Z dS)�)� annotationsN� accept_key� apply_maskz$258EAFA5-E914-47DA-95CA-C5AB0DC85B11�return�strc�v�tjd��}tj|�����S)zB Generate a random key for the Sec-WebSocket-Key header. �)�secrets� token_bytes�base64� b64encode�decode)�keys �`/home/asafur/pinokio/api/open-webui.git/app/env/lib/python3.11/site-packages/websockets/utils.py� generate_keyrs1�� � �b� !� !�C� � �C� � � '� '� )� )�)�rc���tj|tz��������}t j|�����S)z Compute the value of the Sec-WebSocket-Accept header. Args: key: Value of the Sec-WebSocket-Key header. )�hashlib�sha1�GUID�encode�digestr r r)rrs rrrsL�� �<��t��+�+�-�-� .� .� 5� 5� 7� 7�D� � �D� !� !� (� (� *� *�*r�data�bytes�maskc��t|��dkrtd���t�|tj��}|t|��dzz|dt|��dz�z}t�|tj��}||z �t|��tj��S)z Apply masking to the data of a WebSocket message. Args: data: Data to mask. mask: 4-bytes mask. �zmask must contain 4 bytesN)�len� ValueError�int� from_bytes�sys� byteorder�to_bytes)rr�data_int� mask_repeated�mask_ints rrr$s��� �4�y�y�A�~�~��4�5�5�5��~�~�d�C�M�2�2�H��C��I�I��N�+�d�?�S��Y�Y��]�?�.C�C�M��~�~�m�S�]�;�;�H� �x� � )� )�#�d�)�)�S�]� C� C�Cr)rr)rrrr)rrrrrr) � __future__rr rr r"�__all__rrrr�rr�<module>r+s���"�"�"�"�"�"� � � � ��������� � � � � �� &��.��*�*�*�*� +� +� +� +�D�D�D�D�D�Dr
Memory