示例#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