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/CyberPanel/lib64/python3.10/site-packages/pyotp/__pycache__/hotp.cpython-310.pyc
o

��hp
�@sDddlZddlmZmZddlmZddlmZGdd�de�ZdS)�N)�Any�Optional�)�utils)�OTPcs�eZdZdZ					ddedededeed	eed
eddf�fdd
�
Zdedefdd�Z	dedede
fdd�Z				ddeed
eedeedeedef
dd�Z�Z
S)�HOTPz.
    Handler for HMAC-based OTP counters.
    �Nr�s�digits�digest�name�issuer�
initial_count�returncs.|durtj}||_t�j|||||d�dS)a}
        :param s: secret in base32 format
        :param initial_count: starting HMAC counter value, defaults to 0
        :param digits: number of integers in the OTP. Some apps expect this to be 6 digits, others support more.
        :param digest: digest function to use in the HMAC (expected to be SHA1)
        :param name: account name
        :param issuer: issuer
        N)r	r
rrr
)�hashlib�sha1r�super�__init__)�selfr	r
rrr
r��	__class__��@/usr/local/CyberPanel/lib/python3.10/site-packages/pyotp/hotp.pyr
sz
HOTP.__init__�countcCs|�|j|�S)zz
        Generates the OTP for the given count.

        :param count: the OTP HMAC counter
        :returns: OTP
        )�generate_otpr)rrrrr�at$szHOTP.at�otp�countercCst�t|�t|�|���S)z�
        Verifies the OTP passed in against the current counter OTP.

        :param otp: the OTP to check against
        :param counter: the OTP HMAC counter
        )r�
strings_equal�strr)rrrrrr�verify-szHOTP.verify�issuer_name�imagec	Cs@tj|j|r|n|j|r|n|j|r|n|j|��j|j|d�S)a5
        Returns the provisioning URI for the OTP.  This can then be
        encoded in a QR Code and used to provision an OTP app like
        Google Authenticator.

        See also:
            https://github.com/google/google-authenticator/wiki/Key-Uri-Format

        :param name: name of the user account
        :param initial_count: starting HMAC counter value, defaults to 0
        :param issuer_name: the name of the OTP issuer; this will be the
            organization title of the OTP entry in Authenticator
        :returns: provisioning URI
        )rrr
�	algorithmr
r")r�	build_uri�secretrrr
rr
)rrrr!r"rrr�provisioning_uri6s�zHOTP.provisioning_uri)rNNNr)NNNN)�__name__�
__module__�__qualname__�__doc__r�intrrrr�boolr r&�
__classcell__rrrrrsN��������	������r)	r�typingrr�rrrrrrrr�<module>s