def update_password(self, string): '''Update our password to a new one whilst hashing it.''' self.salt = get_random_string(12) self.password = hasher(self.salt + string)
def update_password(self, string): '''Update our password to a new one whilst hashing it.''' self.salt = get_random_string(12) self.password = hasher(self.salt+string)
def validate_password(self, string): '''We return whether our password matches the one we're supplied. This method will hash the string for you so you can pass in the raw string to check our password against.''' return hasher(self.salt + string) == self.password