示例#1
0
文件: user.py 项目: arzh/CS253
	def check_password(self, pw):
		salt = HashUser.break_salt(self.phash)
		return self.phash == HashUser.generate_phash(self.name, pw, salt)
示例#2
0
文件: user.py 项目: arzh/CS253
	def generate_new(cls, name, pw, email=None):
		h = HashUser.generate_phash(name, pw)
		return User(name = name, phash = h, email = email)