Skip to main content

identify_hasher

Return an instance of a loaded password hasher.

Identify hasher algorithm by examining encoded hash, and call get_hasher() to return hasher. Raise ValueError if algorithm cannot be identified, or if hasher is not loaded.

def identify_hasher(
encoded: string
) - > BasePasswordHasher

Return an instance of a loaded password hasher. Identify hasher algorithm by examining encoded hash, and call get_hasher() to return hasher. Raise ValueError if algorithm cannot be identified, or if hasher is not loaded.

Parameters

NameTypeDescription
encodedstringThe encoded password hash string to be analyzed for algorithm identification.

Returns

TypeDescription
BasePasswordHasherAn instance of the password hasher class corresponding to the identified algorithm.