HEX
Server: LiteSpeed
System: Linux php-prod-1.spaceapp.ru 5.15.0-157-generic #167-Ubuntu SMP Wed Sep 17 21:35:53 UTC 2025 x86_64
User: xnsbb3110 (1041)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //usr/local/lib/python3.10/dist-packages/pip/_internal/commands/__pycache__/hash.cpython-310.pyc
o

��h��@s�ddlZddlZddlZddlmZddlmZddlmZm	Z	ddl
mZmZddl
mZmZe�e�ZGdd�de�Zd	ed
edefdd
�ZdS)�N)�Values)�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�F/usr/local/lib/python3.10/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)rN)�__name__�
__module__�__qualname__�__doc__�usage�ignore_require_venvrr�list�str�intr$rrrrr
s
r
r#rrcCsZt|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"4s
�
��r")r0�loggingr �optparser�pip._internal.cli.base_commandr�pip._internal.cli.status_codesrr�pip._internal.utils.hashesrr�pip._internal.utils.miscrr	�	getLoggerr%�loggerr
r,r"rrrr�<module>s
&