ok

Mini Shell

Direktori : /opt/alt/python27/lib64/python2.7/
Upload File :
Current File : //opt/alt/python27/lib64/python2.7/hashlib.pyo

�
�[
bc@s�dZdZee�Zee�ZeZedZd�Zd
�Zdd�Z	dd�Z
y.ddlZe
ZeZ
ejej�ZWnek
r�e	ZeZ
nXxUeD]MZye
e�e�e<Wq�ek
r�ddlZejde�q�Xq�WyddlmZWnsek
r�ddlZddlZdjd�ed�D��Zdjd�ed�D��Zdd�ZnX[[[
[	[
[dS(s�hashlib module - A common interface to many hash functions.

new(name, string='') - returns a new hash object implementing the
                       given hash function; initializing the hash
                       using the given string data.

Named constructor functions are also available, these are much faster
than using new():

md5(), sha1(), sha224(), sha256(), sha384(), and sha512()

More algorithms may be available on your platform but the above are guaranteed
to exist.  See the algorithms_guaranteed and algorithms_available attributes
to find out what algorithm names can be passed to new().

NOTE: If you want the adler32 or crc32 hash functions they are available in
the zlib module.

Choose your hash function wisely.  Some have known collision weaknesses.
sha384 and sha512 will be slow on 32 bit platforms.

Hash objects have these methods:
 - update(arg): Update the hash object with the string arg. Repeated calls
                are equivalent to a single call with the concatenation of all
                the arguments.
 - digest():    Return the digest of the strings passed to the update() method
                so far. This may contain non-ASCII characters, including
                NUL bytes.
 - hexdigest(): Like digest() except the digest is returned as a string of
                double length, containing only hexadecimal digits.
 - copy():      Return a copy (clone) of the hash object. This can be used to
                efficiently compute the digests of strings that share a common
                initial substring.

For example, to obtain the digest of the string 'Nobody inspects the
spammish repetition':

    >>> import hashlib
    >>> m = hashlib.md5()
    >>> m.update("Nobody inspects")
    >>> m.update(" the spammish repetition")
    >>> m.digest()
    '\xbbd\x9c\x83\xdd\x1e\xa5\xc9\xd9\xde\xc9\xa1\x8d\xf0\xff\xe9'

More condensed:

    >>> hashlib.sha224("Nobody inspects the spammish repetition").hexdigest()
    'a4337bc45a8fc544c03f52dc550cd6e1e87021bc896588bd79e901e2'

tmd5tsha1tsha224tsha256tsha384tsha512tnewtalgorithms_guaranteedtalgorithms_availablet
algorithmstpbkdf2_hmaccCsy�|dkr"ddl}|jS|dkrAddl}|jS|dkr�ddl}|d
}|dkrv|jS|dkr�|jSnK|dkr�ddl}|d
}|dkr�|jS|dkr�|jSnWnt	k
r�nXt
d|��dS(NtSHA1Ri����tMD5RtSHA256RtSHA224Rit256t224tSHA512RtSHA384Rt512t384sunsupported hash type (RR(RR(R
RRR(RRRR(t_shaRt_md5t_sha256RRt_sha512RRtImportErrort
ValueError(tnameRRRtbsR((s,/opt/alt/python27/lib64/python2.7/hashlib.pyt__get_builtin_constructorHs0



cCsGy"ttd|�}|�|SWnttfk
rBt|�SXdS(Ntopenssl_(tgetattrt_hashlibtAttributeErrorRR(Rtf((s,/opt/alt/python27/lib64/python2.7/hashlib.pyt__get_openssl_constructordstcCst|�|�S(s|new(name, string='') - Return a new hashing object using the named algorithm;
    optionally initialized with a string.
    (R(Rtstring((s,/opt/alt/python27/lib64/python2.7/hashlib.pyt__py_newpscCs9ytj||�SWntk
r4t|�|�SXdS(s|new(name, string='') - Return a new hashing object using the named algorithm;
    optionally initialized with a string.
    N(R RRR(RR%((s,/opt/alt/python27/lib64/python2.7/hashlib.pyt
__hash_newws
i����Nscode for hash %s was not found.(R
ccs|]}t|dA�VqdS(i\N(tchr(t.0tx((s,/opt/alt/python27/lib64/python2.7/hashlib.pys	<genexpr>�siccs|]}t|dA�VqdS(i6N(R((R)R*((s,/opt/alt/python27/lib64/python2.7/hashlib.pys	<genexpr>�scCsCt|t�st|��nt|ttf�sHtt|��}nt|ttf�srtt|��}nt|�}t|�}t|dd�}t|�|kr�t||�j	�}n|d|t|�}|j
|jt��|j
|jt
��||d�}|dkr4t|��n|dkrL|j}n|dkrgt|��ndt|�jd}	d}
d}x�t|
�|kr:||tjd	|��}ttj|�d
�}
x@t|d�D].}||�}|
ttj|�d
�N}
q�W|d7}|
tj|	|
�7}
q�W|
| S(s�Password based key derivation function 2 (PKCS #5 v2.0)

        This Python implementations based on the hmac module about as fast
        as OpenSSL's PKCS5_PBKDF2_HMAC for short passwords and much faster
        for long passwords.
        t
block_sizei@scSsB|j�}|j�}|j|�|j|j��|j�S(N(tcopytupdatetdigest(tmsgtinnertouterticpytocpy((s,/opt/alt/python27/lib64/python2.7/hashlib.pytprf�s

is%%0%ixiR$s>IiN(t
isinstancetstrt	TypeErrortbytest	bytearraytbufferRRtlenR.R-t	translatet	_trans_36t	_trans_5CRtNonetdigest_sizetstructtpacktinttbinasciithexlifytxranget	unhexlify(t	hash_nametpasswordtsaltt
iterationstdklenR0R1t	blocksizeR4thex_format_stringtdkeytlooptprevtrkeyti((s,/opt/alt/python27/lib64/python2.7/hashlib.pyR
�sB	 
(RRRRRR(RRRR	R
(t__doc__t__always_supportedtsetRRR	t__all__RR#R&R'R Rt
__get_hashtuniontopenssl_md_meth_namesRt__func_nametglobalsRtloggingt	exceptionR
RDRAtjointrangeR>R=R?(((s,/opt/alt/python27/lib64/python2.7/hashlib.pyt<module>8sH		




9	

Zerion Mini Shell 1.0