o
    ¦ƒðjH  ã                   @   sL   d dl mZ d dl mZ d dl mZ dd„ Zddd„Zdd	d
„Zdd„ ZdS )é   )Úencode)Únumber_types)Úpackerc                 C   s   t  tj| |¡S )z&Extract the size prefix from a buffer.)r   ÚGetr   Úint32©ÚbufÚoffset© r
   ú’/tmp/claude-1000/-var-www-html-academy/3f42efd1-c2b7-4d08-9b05-30d86bb35479/scratchpad/piper/venv/lib/python3.10/site-packages/flatbuffers/util.pyÚGetSizePrefix   s   r   Fc                 C   s2   |r|t jj7 }|t jj7 }|tj }| ||… S )z)Extract the file_identifier from a buffer)r   ÚUOffsetTFlagsÚ	bytewidthr   ÚFILE_IDENTIFIER_LENGTH)r   r	   Úsize_prefixedÚendr
   r
   r   ÚGetBufferIdentifier   s
   
r   c                 C   s   t | ||d�}||kS )N)r   )r   )r   r	   Úfile_identifierr   Úgotr
   r
   r   ÚBufferHasIdentifier%   s   r   c                 C   s   | |t jj fS )zhCreate a slice of a size-prefixed buffer that has

  its position advanced just past the size prefix.
  )r   Ú
Int32Flagsr   r   r
   r
   r   ÚRemoveSizePrefix*   s   r   N)F)Ú r   r   r   r   r   r   r   r
   r
   r
   r   Ú<module>   s   

