o
    ߭h                     @  sh   d dl mZ d dlZd dlZd dlZddlmZmZmZm	Z	m
Z
mZ dd	d
Zedkr2eej dS dS )    )annotationsN   )DEFAULT_HASH_LENGTHDEFAULT_MEMORY_COSTDEFAULT_PARALLELISMDEFAULT_TIME_COSTPasswordHasherprofilesargv	list[str]returnNonec           
      C  s  t jdd}|jdtddd |jdtdtd	 |jd
tdtd	 |jdtdtd	 |jdtdtd	 |jdtdd d	 |	| dd  }d}|j
rVttt|j
 }nt|j|j|j|jd}||}|jdf|jdf|jdf|jdfd}td|jf  t| D ]\}}td||d |d f  qtd tjd|d|dd |jd!|jd"|jd#|jd$	|jd%}	td&|	|j d' d(d) d S )*NzBenchmark Argon2.)descriptionz-nd   z Number of iterations to measure.)typedefaulthelpz-tz`time_cost`)r   r   r   z-mz`memory_cost`z-pz`parallelism`z-lz`hash_length`z	--profilez2A profile from `argon2.profiles. Takes precedence.r   s   secret)	time_costmemory_costparallelismhash_len
iterationsKiBthreadsbyteszRunning Argon2id %d times with:z	%s: %d %sr   z
Measuring...z
ph.verify(z, )zLfrom argon2 import PasswordHasher, Type

ph = PasswordHasher(
    time_cost=z,
    memory_cost=z,
    parallelism=z,
    hash_len=z,
)
gc.enable())setupnumber
i  z.1fzms per password verification)argparseArgumentParseradd_argumentintr   r   r   r   str
parse_argsprofiler   from_parametersgetattrr	   uppertmplhashr   r   r   r   printnsorteditemstimeit)
r
   parserargspasswordphr-   paramskvduration r;   T/var/www/html/stock_analysis/be/venv/lib/python3.10/site-packages/argon2/__main__.pymain   st   

 r=   __main__)r
   r   r   r   )
__future__r   r   sysr2    r   r   r   r   r   r	   r=   __name__r
   r;   r;   r;   r<   <module>   s    

F