MCPcopy Index your code
hub / github.com/pyfa-org/Pyfa / isPasswordValid

Method isPasswordValid

eos/saveddata/user.py:41–48  ·  view source on GitHub ↗
(self, pw)

Source from the content-addressed store, hash-verified

39 self.password = ("%s%s" % (h.hexdigest(), salt))
40
41 def isPasswordValid(self, pw):
42 if self.password is None:
43 return False
44 salt = self.password[-32:]
45 h = hashlib.new("sha256")
46 h.update(pw)
47 h.update(salt)
48 return self.password == ("%s%s" % (h.hexdigest(), salt))
49
50 @validates("ID", "username", "password", "admin")
51 def validator(self, key, val):

Callers

nothing calls this directly

Calls 2

newMethod · 0.80
updateMethod · 0.45

Tested by

no test coverage detected