from trac.core import Component, Interface


class IPasswordHashMethod(Interface):

    def generate_hash(user: str, password: str) -> str: ...
    def check_hash(user: str, password: str, hash: str) -> bool: ...


class HtPasswdHashMethod(Component):

    def generate_hash(self, user: str, password: str) -> str: ...
    def check_hash(self, user: str, password: str, hash: str) -> bool: ...


class HtDigestHashMethod(Component):

    def generate_hash(self, user: str, password: str) -> str: ...
    def check_hash(self, user: str, password: str, hash: str) -> bool: ...


def htdigest(user: str, realm: str, password: str) -> str: ...
def generate_hash(password: str, method: str) -> str: ...
def check_hash(password: str, the_hash: str) -> bool: ...
def _sha_digest(password: str) -> str: ...
def _passlib_generate_hash(password: str, method: str) -> str: ...
def _passlib_check_hash(password: str, the_hash: str) -> bool: ...
def _crypt_generate_hash(password: str, method: str) -> str: ...
def _crypt_check_hash(password: str, the_hash: str) -> bool: ...
def _mksalt(method: str) -> str: ...
def _unavai_error(): ...
def _unavai_generate_hash(password: str, method: str) -> str: ...
def _unavai_check_hash(password: str, the_hash: str) -> bool: ...
