https://t.me/AnonymousX5
Server : Apache
System : Linux cvar2.toservers.com 3.10.0-962.3.2.lve1.5.73.el7.x86_64 #1 SMP Wed Aug 24 21:31:23 UTC 2022 x86_64
User : njnconst ( 1116)
PHP Version : 8.4.18
Disable Function : NONE
Directory :  /lib/python2.7/site-packages/asn1crypto/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python2.7/site-packages/asn1crypto/util.pyc
�
y�\c@`s
dZddlmZmZmZmZddlZddlZddlmZm	Z	m
Z
ddlmZddl
mZmZddlmZdd	lmZejd
kr�ddlmZmZnddlmZmZejd(krRdd
lmZmZeZedd�Z ed�Z!defd��YZ"dd)d��YZ#n1ddlm#Z#eZedd�Z ed�Z!idd6dd6dd6dd6dd6dd6dd6dd6dd 6dd!6dd"6dd#6Z$d$e%fd%��YZ&d&e%fd'��YZ'dS(*u
Miscellaneous data helpers, including functions for converting integers to and
from bytes and UTC timezone. Exports the following items:

 - OrderedDict()
 - int_from_bytes()
 - int_to_bytes()
 - timezone.utc
 - inet_ntop()
 - inet_pton()
 - uri_to_iri()
 - iri_to_uri()
i(tunicode_literalstdivisiontabsolute_importtprint_functionN(tdatetimetdatettimei(tunwrap(t
iri_to_urit
uri_to_iri(tOrderedDict(t	type_nameuwin32(t	inet_ntopt	inet_ptoni(t	timedeltattzinfocC`s;t}|rd|dkrdt}ttjtdt|��d�d�}|d|>d|>}nd|}t|�d@r�d|}n|jd�}|r�|r�t|dd!�d@r�d	|}n|dk	r|r�d
}nd	}||t|�|}n0|r7t|dd!�d@dkr7d
|}n|S(uu
        Converts an integer to a byte string

        :param value:
            The integer to convert

        :param signed:
            If the byte string should be encoded using two's complement

        :param width:
            None == auto, otherwise an integer of the byte width for the return
            value

        :return:
            A byte string
        iu%xg@iiu0uhexi�ts�N(
tFalsetTruetinttmathtceiltlentabstdecodetordtNone(tvaluetsignedtwidthtis_negtbitsthex_strtoutputtpad_char((s5/tmp/pip-install-A1qMVe/asn1crypto/asn1crypto/util.pytint_to_bytes)s&-

$
	#
cC`si|dkrdSt|jd�d�}|s2|St|dd!�d@ret|�d}|d|>S|S(u
        Converts a byte string to an integer

        :param value:
            The byte string to convert

        :param signed:
            If the byte string should be interpreted using two's complement

        :return:
            An integer
        tiuhexiii�i(tlongtencodeRR(RRtnumtbit_len((s5/tmp/pip-install-A1qMVe/asn1crypto/asn1crypto/util.pytint_from_bytesVstutccB`s#eZd�Zd�Zd�ZRS(cC`sdS(Ns	UTC+00:00((tselft_((s5/tmp/pip-install-A1qMVe/asn1crypto/asn1crypto/util.pyttznameuscC`s
td�S(Ni(R(R+R,((s5/tmp/pip-install-A1qMVe/asn1crypto/asn1crypto/util.pyt	utcoffsetxscC`s
td�S(Ni(R(R+R,((s5/tmp/pip-install-A1qMVe/asn1crypto/asn1crypto/util.pytdst{s(t__name__t
__module__R-R.R/(((s5/tmp/pip-install-A1qMVe/asn1crypto/asn1crypto/util.pyR*ss		ttimezonecB`seZe�ZRS((R0R1R*(((s5/tmp/pip-install-A1qMVe/asn1crypto/asn1crypto/util.pyR2~s(R2cC`s�|dkr�|rc|dkr7t|d�j�}n|j�}|ddkro|d7}qon|j�}tj|d�p�d}n|j|ddd|�S(uu
        Converts an integer to a byte string

        :param value:
            The integer to convert

        :param signed:
            If the byte string should be encoded using two's complement

        :param width:
            None == auto, otherwise an integer of the byte width for the return
            value

        :return:
            A byte string
        iiit	byteorderubigRN(RRt
bit_lengthRRtto_bytes(RRRt
bits_required((s5/tmp/pip-install-A1qMVe/asn1crypto/asn1crypto/util.pyR#�scC`stj|dd|�S(u
        Converts a byte string to an integer

        :param value:
            The byte string to convert

        :param signed:
            If the byte string should be interpreted using two's complement

        :return:
            An integer
        ubigR(Rt
from_bytes(RR((s5/tmp/pip-install-A1qMVe/asn1crypto/asn1crypto/util.pyR)�siiiiiiiiii	i
iit
extended_datecB`s�eZdZdZdZdZd�Zd�Zd�Z	d�Z
dddd�Zd�Zd�Z
d�Zd	�Zd
�Zd�Zd�Zd
�Zd�Zd�Zd�ZRS(u�
    A datetime.date-like object that can represent the year 0. This is just
    to handle 0000-01-01 found in some certificates.
    cC`s�|dkrtd��n|dks3|dkrBtd��n|dks^|t|krmtd��n||_||_||_dS(u�
        :param year:
            The integer 0

        :param month:
            An integer from 1 to 12

        :param day:
            An integer from 1 to 31
        iuyear must be 0iiumonth is out of rangeuday is out of rangeN(t
ValueErrort_DAYS_PER_MONTH_YEAR_0tyeartmonthtday(R+R;R<R=((s5/tmp/pip-install-A1qMVe/asn1crypto/asn1crypto/util.pyt__init__�s		cC`s�|jdd�}td|j|j�}d|kr~|jd�}|jdd�}|jdd�}|jd|�}nd|kr�|jd�}|jdd�}|jdd�}|jd|�}n|j|�S(	u�
        Performs strftime(), always returning a unicode string

        :param format:
            A strftime() format string

        :return:
            A unicode string of the formatted date
        u%Yu0000i�u%cu2000u%u%%u%x(treplaceRR<R=tstrftime(R+tformatttemptc_outtx_out((s5/tmp/pip-install-A1qMVe/asn1crypto/asn1crypto/util.pyt_format�scC`s
|jd�S(u�
        Formats the date as %Y-%m-%d

        :return:
            The date formatted to %Y-%m-%d as a unicode string in Python 3
            and a byte string in Python 2
        u
0000-%m-%d(R@(R+((s5/tmp/pip-install-A1qMVe/asn1crypto/asn1crypto/util.pyt	isoformats	cC`s&|j|�}tr"|jd�S|S(u�
        Formats the date using strftime()

        :param format:
            The strftime() format string

        :return:
            The formatted date as a unicode string in Python 3 and a byte
            string in Python 2
        uutf-8(REtpy2R&(R+RAR!((s5/tmp/pip-install-A1qMVe/asn1crypto/asn1crypto/util.pyR@s
cC`ss|dkr|j}n|dkr0|j}n|dkrH|j}n|dkr]t}nt}||||�S(u�
        Returns a new datetime.date or asn1crypto.util.extended_date
        object with the specified components replaced

        :return:
            A datetime.date or asn1crypto.util.extended_date object
        iN(RR;R<R=RR8(R+R;R<R=tcls((s5/tmp/pip-install-A1qMVe/asn1crypto/asn1crypto/util.pyR?'s		cC`str|j�S|j�SdS(N(RGt	__bytes__t__unicode__(R+((s5/tmp/pip-install-A1qMVe/asn1crypto/asn1crypto/util.pyt__str__Bs
cC`s|j�jd�S(Nuutf-8(RJR&(R+((s5/tmp/pip-install-A1qMVe/asn1crypto/asn1crypto/util.pyRIHscC`s
|jd�S(Nu%Y-%m-%d(RE(R+((s5/tmp/pip-install-A1qMVe/asn1crypto/asn1crypto/util.pyRJKscC`s)t||j�stS|j|�dkS(Ni(t
isinstancet	__class__Rt__cmp__(R+tother((s5/tmp/pip-install-A1qMVe/asn1crypto/asn1crypto/util.pyt__eq__NscC`s|j|�S(N(RP(R+RO((s5/tmp/pip-install-A1qMVe/asn1crypto/asn1crypto/util.pyt__ne__SscC`sttdt|����dS(Nu�
            An asn1crypto.util.extended_date object can only be compared to
            an asn1crypto.util.extended_date or datetime.date object, not %s
            (t	TypeErrorRR(R+RO((s5/tmp/pip-install-A1qMVe/asn1crypto/asn1crypto/util.pyt_comparison_errorVscC`s�t|t�rdSt||j�s5|j|�n|j|j|jf}|j|j|jf}||krudS||kr�dSdS(Ni����ii(RLRRMRSR;R<R=(R+ROtsttot((s5/tmp/pip-install-A1qMVe/asn1crypto/asn1crypto/util.pyRN_scC`s|j|�dkS(Ni(RN(R+RO((s5/tmp/pip-install-A1qMVe/asn1crypto/asn1crypto/util.pyt__lt__wscC`s|j|�dkS(Ni(RN(R+RO((s5/tmp/pip-install-A1qMVe/asn1crypto/asn1crypto/util.pyt__le__zscC`s|j|�dkS(Ni(RN(R+RO((s5/tmp/pip-install-A1qMVe/asn1crypto/asn1crypto/util.pyt__gt__}scC`s|j|�dkS(Ni(RN(R+RO((s5/tmp/pip-install-A1qMVe/asn1crypto/asn1crypto/util.pyt__ge__�sN(R0R1t__doc__RR;R<R=R>RERFR@R?RKRIRJRPRQRSRNRVRWRXRY(((s5/tmp/pip-install-A1qMVe/asn1crypto/asn1crypto/util.pyR8�s(															textended_datetimec	B`s%eZdZdZdZdZdZdZdZ	dZ
dZdddddd�Zd�Z
d�Zd�Zd�Zd�Zd�Zd	d
�Zd�Zddddddddd�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z RS(u�
    A datetime.datetime-like object that can represent the year 0. This is just
    to handle 0000-01-01 found in some certificates.
    ic		C`sU|dkrtd��n|dks3|dkrBtd��n|dks^|t|krmtd��n|dks�|dkr�td��n|dks�|d	kr�td
��n|dks�|d	kr�td��n|dks�|dkr	td
��n||_||_||_||_||_||_||_||_	dS(u�
        :param year:
            The integer 0

        :param month:
            An integer from 1 to 12

        :param day:
            An integer from 1 to 31

        :param hour:
            An integer from 0 to 23

        :param minute:
            An integer from 0 to 59

        :param second:
            An integer from 0 to 59

        :param microsecond:
            An integer from 0 to 999999
        iuyear must be 0iiumonth is out of rangeuday is out of rangeiuhour is out of rangei;uminute is out of rangeusecond is out of rangei?Bumicrosecond is out of rangeN(
R9R:R;R<R=thourtminutetsecondtmicrosecondR(	R+R;R<R=R\R]R^R_R((s5/tmp/pip-install-A1qMVe/asn1crypto/asn1crypto/util.pyR>�s,							cC`st|j|j|j�S(uS
        :return:
            An asn1crypto.util.extended_date of the date
        (R8R;R<R=(R+((s5/tmp/pip-install-A1qMVe/asn1crypto/asn1crypto/util.pyR�scC`s%t|j|j|j|j|j�S(uI
        :return:
            A datetime.time object of the time
        (RR\R]R^R_R(R+((s5/tmp/pip-install-A1qMVe/asn1crypto/asn1crypto/util.pyR�scC`s/|jdkrdS|jj|jdd��S(u\
        :return:
            None or a datetime.timedelta() of the offset from UTC
        R;i�N(RRR.R?(R+((s5/tmp/pip-install-A1qMVe/asn1crypto/asn1crypto/util.pyR.�scC`s/|jdkrdS|jj|jdd��S(ui
        :return:
            None or a datetime.timedelta() of the daylight savings time offset
        R;i�N(RRR/R?(R+((s5/tmp/pip-install-A1qMVe/asn1crypto/asn1crypto/util.pyR/�scC`s/|jdkrdS|jj|jdd��S(u�
        :return:
            None or the name of the timezone as a unicode string in Python 3
            and a byte string in Python 2
        R;i�N(RRR-R?(R+((s5/tmp/pip-install-A1qMVe/asn1crypto/asn1crypto/util.pyR-�sc	C`s�|jdd�}td|j|j|j|j|j|j|j�}d|kr�|j	d�}|jdd�}|jdd�}|jd|�}nd|kr�|j	d�}|jdd�}|jdd�}|jd|�}n|j	|�S(	u�
        Performs strftime(), always returning a unicode string

        :param format:
            A strftime() format string

        :return:
            A unicode string of the formatted datetime
        u%Yu0000i�u%cu2000u%u%%u%x(
R?RR<R=R\R]R^R_RR@(R+RARBRCRD((s5/tmp/pip-install-A1qMVe/asn1crypto/asn1crypto/util.pyRE�s*uTcC`s1|jdkr |jd|�S|jd|�S(uj
        Formats the date as "%Y-%m-%d %H:%M:%S" with the sep param between the
        date and time portions

        :param set:
            A single character of the separator to place between the date and
            time

        :return:
            The formatted datetime as a unicode string in Python 3 and a byte
            string in Python 2
        iu0000-%%m-%%d%s%%H:%%M:%%Su0000-%%m-%%d%s%%H:%%M:%%S.%%f(R_R@(R+tsep((s5/tmp/pip-install-A1qMVe/asn1crypto/asn1crypto/util.pyRFscC`s&|j|�}tr"|jd�S|S(u�
        Formats the date using strftime()

        :param format:
            The strftime() format string

        :return:
            The formatted date as a unicode string in Python 3 and a byte
            string in Python 2
        uutf-8(RERGR&(R+RAR!((s5/tmp/pip-install-A1qMVe/asn1crypto/asn1crypto/util.pyR@1s
c	
	C`s�|dkr|j}n|dkr0|j}n|dkrH|j}n|dkr`|j}n|dkrx|j}n|dkr�|j}n|dkr�|j}n|dkr�|j}n|dkr�t	}	nt
}	|	||||||||�S(u�
        Returns a new datetime.datetime or asn1crypto.util.extended_datetime
        object with the specified components replaced

        :return:
            A datetime.datetime or asn1crypto.util.extended_datetime object
        iN(RR;R<R=R\R]R^R_RRR[(
R+R;R<R=R\R]R^R_RRH((s5/tmp/pip-install-A1qMVe/asn1crypto/asn1crypto/util.pyR?Bs8
	cC`str|j�S|j�SdS(N(RGRIRJ(R+((s5/tmp/pip-install-A1qMVe/asn1crypto/asn1crypto/util.pyRKms
cC`s|j�jd�S(Nuutf-8(RJR&(R+((s5/tmp/pip-install-A1qMVe/asn1crypto/asn1crypto/util.pyRIsscC`s/d}|jdkr"|d7}n|j|�S(Nu%Y-%m-%d %H:%M:%Siu.%f(R_RE(R+RA((s5/tmp/pip-install-A1qMVe/asn1crypto/asn1crypto/util.pyRJvs
cC`s)t||j�stS|j|�dkS(Ni(RLRMRRN(R+RO((s5/tmp/pip-install-A1qMVe/asn1crypto/asn1crypto/util.pyRP|scC`s|j|�S(N(RP(R+RO((s5/tmp/pip-install-A1qMVe/asn1crypto/asn1crypto/util.pyRQ�scC`sttdt|����dS(u�
        Raises a TypeError about the other object not being suitable for
        comparison

        :param other:
            The object being compared to
        u�
            An asn1crypto.util.extended_datetime object can only be compared to
            an asn1crypto.util.extended_datetime or datetime.datetime object,
            not %s
            N(RRRR(R+RO((s5/tmp/pip-install-A1qMVe/asn1crypto/asn1crypto/util.pyRS�s	cC`s|j�}|j�}|dk	r0|dksH|dkrW|dk	rWtd��nt|t�rjdSt||j�s�|j|�n|j|j|j	|j
|j|j|j
|f}|j|j|j	|j
|j|j|j
|f}||krdS||krdSdS(Nu5can't compare offset-naive and offset-aware datetimesi����ii(R.RRRRLRRMRSR;R<R=R\R]R^R_(R+ROtsotooRTRU((s5/tmp/pip-install-A1qMVe/asn1crypto/asn1crypto/util.pyRN�s:0		cC`s|j|�dkS(Ni(RN(R+RO((s5/tmp/pip-install-A1qMVe/asn1crypto/asn1crypto/util.pyRV�scC`s|j|�dkS(Ni(RN(R+RO((s5/tmp/pip-install-A1qMVe/asn1crypto/asn1crypto/util.pyRW�scC`s|j|�dkS(Ni(RN(R+RO((s5/tmp/pip-install-A1qMVe/asn1crypto/asn1crypto/util.pyRX�scC`s|j|�dkS(Ni(RN(R+RO((s5/tmp/pip-install-A1qMVe/asn1crypto/asn1crypto/util.pyRY�sN(!R0R1RZRR;R<R=R\R]R^R_RR>RRR.R/R-RERFR@R?RKRIRJRPRQRSRNRVRWRXRY(((s5/tmp/pip-install-A1qMVe/asn1crypto/asn1crypto/util.pyR[�s>6			
	
		'	*							(			(i(((RZt
__future__RRRRRtsysRRRt_errorsRt_iriRR	t_ordereddictR
t_typesRtplatformt_inetRR
tsockettversion_infoRRRRGRRR#R)R*R2R:tobjectR8R[(((s5/tmp/pip-install-A1qMVe/asn1crypto/asn1crypto/util.pyt<module>sJ"-
�

https://t.me/AnonymousX5 - 2025