HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //usr/lib/python3/dist-packages/pip/_internal/commands/__pycache__/hash.cpython-310.pyc
o

@%Ne��@s�ddlZddlZddlZddlmZddlmZddlmZddl	m
Z
mZddlm
Z
mZddlmZmZe�e�ZGdd	�d	e�Zd
ededefd
d�ZdS)�N)�Values)�List)�Command)�ERROR�SUCCESS)�
FAVORITE_HASH�
STRONG_HASHES)�read_chunks�write_outputc@s<eZdZdZdZdZddd�Zded	ee	de
fd
d�ZdS)
�HashCommandz�
    Compute a hash of a local package archive.

    These can be used with --hash in a requirements file to do repeatable
    installs.
    z%prog [options] <file> ...T�returnNcCs:|jjdddtdtd�d�t��d�|j�d|j�dS)	Nz-az--algorithm�	algorithm�storez$The hash algorithm to use: one of {}z, )�dest�choices�action�default�helpr)�cmd_opts�
add_optionrr�format�join�parser�insert_option_group)�self�r�=/usr/lib/python3/dist-packages/pip/_internal/commands/hash.py�add_optionss��zHashCommand.add_options�options�argscCs>|s|j�tj�tS|j}|D]}td||t||��qtS)Nz%s:
--hash=%s:%s)	r�print_usage�sys�stderrrr
r
�
_hash_of_filer)rrrr
�pathrrr�run(s�zHashCommand.run)rN)�__name__�
__module__�__qualname__�__doc__�usage�ignore_require_venvrrr�str�intr%rrrrrs
rr$r
rcCsZt|d��}t�|�}t|�D]}|�|�qWd�|��S1s$wY|��S)z!Return the hash digest of a file.�rbN)�open�hashlib�newr	�update�	hexdigest)r$r
�archive�hash�chunkrrrr#5s
�
��r#)r0�loggingr!�optparser�typingr�pip._internal.cli.base_commandr�pip._internal.cli.status_codesrr�pip._internal.utils.hashesrr�pip._internal.utils.miscr	r
�	getLoggerr&�loggerrr,r#rrrr�<module>s
&