
    J/i                     B    S SK r S SKJr  SSKJr  SrSr " S S\5      rg)	    N)Optional   )TOTP23456789BCDFGHJKMNPQRTVWXY   c                   x   ^  \ rS rSrSr    SS\S\\   S\\   S\S\S	S4U 4S
 jjjrS\S	\4U 4S jjr	Sr
U =r$ )Steam
   z5
Steam's custom TOTP. Subclass of `pyotp.totp.TOTP`.
Nsnameissuerintervaldigitsreturnc                 N   > X@l         [        TU ]	  US[        R                  X#S9  g)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   r   digestr   r   N)r   super__init__hashlibsha1)selfr   r   r   r   r   	__class__s         M/home/james-whalen/.local/lib/python3.13/site-packages/pyotp/contrib/steam.pyr   Steam.__init__   s$     !1R4W    inputc                    > [         T	U ]  U5      n[        U5      nSn[        [        5      n[        [        5       H!  nX5-  n[        [        U5         nXH-  nX5-  nM#     U$ )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   Steam.generate_otp    sj    
 7'.x=
+&+,A(Cs3x(DJ$H	 - r   )r   )NN   r   )__name__
__module____qualname____firstlineno____doc__strr   r    r   r   __static_attributes____classcell__)r   s   @r   r	   r	   
   s     # $XX smX 	X
 X X 
X X"# #  r   r	   )r   typingr   totpr   r"   r$   r	    r   r   <module>r9      s%      * 'D 'r   