
    VeIi                     J    d dl Z d dlmZ ddlmZ dZdZ G d de          ZdS )	    N)Optional   )TOTP23456789BCDFGHJKMNPQRTVWXY   c                   r     e Zd ZdZ	 	 	 	 ddedee         dee         ded	ed
df fdZded
ef fdZ xZ	S )Steamz=
    Steam's custom TOTP. Subclass of `pyotp.totp.TOTP`.
    N   r   snameissuerintervaldigitsreturnc                 v    || _         t                                          |dt          j        ||           dS )z
        :param s: secret in base32 format
        :param interval: the time interval in seconds for OTP. This defaults to 30.
        :param name: account name
        :param issuer: issuer
        
   )r   r   digestr   r   N)r   super__init__hashlibsha1)selfr   r   r   r   r   	__class__s         X/var/www/html/MCyber-Diagnostic/venv/lib/python3.11/site-packages/pyotp/contrib/steam.pyr   zSteam.__init__   s8     !1R4PVWWWWW    inputc                    t                                          |          }t          |          }d}t          t                    }t          t                    D ]+}||z  }t          t          |                   }||z  }||z  },|S )z
        :param input: the HMAC counter value to use as the OTP input.
            Usually either the counter, or the computed integer based on the Unix timestamp
         )r   generate_otpintlenSTEAM_CHARSrangeSTEAM_DEFAULT_DIGITS)
r   r   str_codeint_code
steam_codetotal_chars_poscharr   s
            r   r   zSteam.generate_otp    s    
 77''..x==
+&&+,, 	% 	%A[(Cs3xx(D$J$HHr   )NNr
   r   )
__name__
__module____qualname____doc__strr   r    r   r   __classcell__)r   s   @r   r	   r	   
   s          # $X XX smX 	X
 X X 
X X X X X X"# #          r   r	   )r   typingr   totpr   r"   r$   r	    r   r   <module>r5      sq                * ' ' ' ' 'D ' ' ' ' 'r   