o
    Bd\R  ã                   @   s€   d Z dZg d¢ZddlT ddlmZ z	ddlZejZW n e	y*   ddl
Z
e
ZY nw G dd„ deƒZdd	d
„ZejZejZdS )a�  SHA-1 cryptographic hash algorithm.

SHA-1_ produces the 160 bit digest of a message.

    >>> from Crypto.Hash import SHA
    >>>
    >>> h = SHA.new()
    >>> h.update(b'Hello')
    >>> print h.hexdigest()

*SHA* stands for Secure Hash Algorithm.

This algorithm is not considered secure. Do not use it for new designs.

.. _SHA-1: http://csrc.nist.gov/publications/fips/fips180-2/fips180-2.pdf
z$Id$)ÚnewÚdigest_sizeÚSHA1Hashé    )Ú*)ÚHashAlgoNc                   @   s4   e Zd ZdZedƒZdZdZd
dd„Zd
dd	„Z	dS )r   zJClass that implements a SHA-1 hash
    
    :undocumented: block_size
    z+é   é@   Nc                 C   s   t  | t|¡ d S ©N)r   Ú__init__ÚhashFactory©ÚselfÚdata© r   úA/var/www/html/env/lib/python3.10/site-packages/Crypto/Hash/SHA.pyr
   I   s   zSHA1Hash.__init__c                 C   s   t |ƒS r	   )r   r   r   r   r   r   L   s   zSHA1Hash.newr	   )
Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚbÚoidr   Ú
block_sizer
   r   r   r   r   r   r   6   s    
r   c                 C   s   t ƒ  | ¡S )a  Return a fresh instance of the hash object.

    :Parameters:
       data : byte string
        The very first chunk of the message to hash.
        It is equivalent to an early call to `SHA1Hash.update()`.
        Optional.

    :Return: A `SHA1Hash` object
    )r   r   )r   r   r   r   r   O   s   r   r	   )r   Ú_revision__Ú__all__ÚCrypto.Util.py3compatÚCrypto.Hash.hashalgor   ÚhashlibÚsha1r   ÚImportErrorÚshar   r   r   r   r   r   r   r   Ú<module>   s    
þ

