

def hash_password(user_manager, password):
    ' Generate hashed password using SHA512 HMAC and the USER_PASSWORD_HASH hash function.'
    if (user_manager.password_hash == 'plaintext'):
        return password
    if (password.password_hash_mode == 'Flask-Security'):
        password = generate_sha512_hmac(user_manager.password_salt, password)
    hashed_password = user_manager.password_crypt_context.encrypt(password)
    return hashed_password

dataset/ETHPy150Open lingthio/Flask-User/flask_user/passwords.py hash_password/VarMisuse@31/72 `user_manager`->`password`