https://t.me/RX1948
Server : Apache
System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
User : dh_edsupp ( 6597262)
PHP Version : 8.2.26
Disable Function : NONE
Directory :  /lib/python3/dist-packages/rsa/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/rsa/__pycache__/parallel.cpython-310.pyc
o

j��`	�@s�dZddlZddlmZddlZddlZdededdfdd�Z	ded	edefd
d�Z
dgZedkr^e
d
�ddlZed�D]Ze��\ZZerIneddkrWerWe
de�q=e
d�dSdS)z�Functions for parallel computation on multiple cores.

Introduced in Python-RSA 3.1.

.. note::

    Requires Python 2.6 or newer.

�N)�
Connection�nbits�pipe�returncCs*	tj�|�}tj�|�r|�|�dSq)N)�rsa�randnum�read_random_odd_int�prime�is_prime�send)rr�integer�r
�./usr/lib/python3/dist-packages/rsa/parallel.py�_find_prime s
�r�poolsizecs�tjdd�\}�z#��fdd�t|�D�}|D]}|��q|��}W|�����n	|�����w|D]}|��q7|S)aUReturns a prime number that can be stored in 'nbits' bits.

    Works in multiple threads at the same time.

    >>> p = getprime(128, 3)
    >>> rsa.prime.is_prime(p-1)
    False
    >>> rsa.prime.is_prime(p)
    True
    >>> rsa.prime.is_prime(p+1)
    False

    >>> from rsa import common
    >>> common.bit_size(p) == 128
    True

    F)�duplexcsg|]}tjt��fd��qS))�target�args)�mp�Processr)�.0�_�r�	pipe_sendr
r�
<listcomp>Aszgetprime.<locals>.<listcomp>)r�Pipe�range�start�recv�close�	terminate)rr�	pipe_recv�procs�p�resultr
rr�getprime*s


�

r%�__main__z'Running doctests 1000x or until failure�d�
z%i timesz
Doctests done)�__doc__�multiprocessingr�multiprocessing.connectionr�	rsa.primer�rsa.randnum�intrr%�__all__�__name__�print�doctestr�count�testmod�failures�testsr
r
r
r�<module>s(

(��

https://t.me/RX1948 - 2025