Password Hash Matching Function

  • Share this:

Code introduction


This function checks if a password matches a given hash. It takes a password string and a hash as inputs and returns a boolean indicating whether the password matches.


Technology Stack : bcrypt

Code Type : Function

Code Difficulty : Intermediate


                
                    
import bcrypt

def check_password_stretch(password, hashed):
    return bcrypt.checkpw(password.encode('utf-8'), hashed)                
              
Tags: