<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet"
        integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.3.0/css/all.min.css"
        integrity="sha512-SzlrxWUlpfuzQ+pcUCosxcglQRNAq/DZjVsC0lE40xsADsfeQoEypE+enwcOiGjk/bSuGGKHEyjSoQ1zVisanQ=="
        crossorigin="anonymous" referrerpolicy="no-referrer" />
</head>
</html>
U
    .e                     @   s   d dl mZ d dlZd dlZd dlZd dlmZ d dlmZ d dl	m
Z
mZ d dlmZmZ eeZG dd deZd	d
 ZdS )    )absolute_importN)Command)ERROR)FAVORITE_HASHSTRONG_HASHES)read_chunkswrite_outputc                       s0   e Zd ZdZdZdZ fddZdd Z  ZS )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> ...Tc                    sJ   t t| j|| | jjdddtdtddt d | j	d| j d S )	Nz-az--algorithm	algorithmZstorez$The hash algorithm to use: one of %sz, )destchoicesactiondefaulthelpr   )
superr	   __init__Zcmd_optsZ
add_optionr   r   joinparserZinsert_option_group)selfargskw	__class__ ?/usr/lib/python3.8/site-packages/pip/_internal/commands/hash.pyr      s     zHashCommand.__init__c                 C   s>   |s| j tj tS |j}|D ]}td||t|| q d S )Nz%s:
--hash=%s:%s)r   Zprint_usagesysstderrr   r
   r   _hash_of_file)r   Zoptionsr   r
   pathr   r   r   run)   s      zHashCommand.run)	__name__
__module____qualname____doc__ZusageZignore_require_venvr   r   __classcell__r   r   r   r   r	      s
   r	   c              	   C   s@   t | d(}t|}t|D ]}|| qW 5 Q R X | S )z!Return the hash digest of a file.rb)openhashlibnewr   updateZ	hexdigest)r   r
   archivehashchunkr   r   r   r   4   s
    
r   )Z
__future__r   r'   Zloggingr   Zpip._internal.cli.base_commandr   Zpip._internal.cli.status_codesr   Zpip._internal.utils.hashesr   r   Zpip._internal.utils.miscr   r   Z	getLoggerr    Zloggerr	   r   r   r   r   r   <module>   s   
"