Пример #1
0
 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)
Пример #2
0
 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)
Пример #3
0
    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
Пример #4
0
    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