[ Root System Explorer ]
Location:
Root
/
proc
/
thread-self
/
root
/
proc
/
thread-self
/
root
/
opt
/
gsutil
/
third_party
/
rsa
/
rsa
/
__pycache__
+ Folder
+ File
Upload
Editing: _compat.cpython-39.pyc
a �'k`� � @ s� d Z ddlmZ ddlZddlZddlmZ ejZdZ dZ dZejd dkZ ee krZd Znee krhd Znd Ze r�eefZeZejZnefZeZeZdd� Zd d� Zdd� Zdd� Zdd� Zd efdd�ZdS )zPython compatibility wrappers.� )�absolute_importN��packl ���� i���i� � �@ � c C s$ t rtj�| � ntjj�| � dS )z2Writes bytes to stdout :type data: bytes N)�PY2�sys�stdout�write�buffer)�data� r �*/opt/gsutil/third_party/rsa/rsa/_compat.py�write_to_stdout5 s r c C s t | t�S )z� Determines whether the given value is a byte string. :param obj: The value to test. :returns: ``True`` if ``value`` is a byte string; ``False`` otherwise. )� isinstance�bytes��objr r r �is_bytesA s r c C s t | t�S )z� Determines whether the given value is an integer. :param obj: The value to test. :returns: ``True`` if ``value`` is an integer; ``False`` otherwise. )r � integer_typesr r r r � is_integerM s r c C s t d| �S )ad Converts a number between 0 and 255 (both inclusive) to a base-256 (byte) representation. Use it as a replacement for ``chr`` where you are expecting a byte because this will work on all current versions of Python:: :param num: An unsigned integer between 0 and 255 (both inclusive). :returns: A single byte. �Br )�numr r r �byteY s r c C s6 t rd�dd� t| |�D ��S tdd� t| |�D ��S )a� Returns the bitwise XOR result between two bytes objects, b1 ^ b2. Bitwise XOR operation is commutative, so order of parameters doesn't generate different results. If parameters have different length, extra length of the largest one is ignored. :param b1: First bytes object. :param b2: Second bytes object. :returns: Bytes object, result of XOR operation. � c s s&