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

Method encodeAndSetPassword

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

Source from the content-addressed store, hash-verified

32 self.admin = admin
33
34 def encodeAndSetPassword(self, pw):
35 h = hashlib.new("sha256")
36 salt = "".join([random.choice(string.letters) for _ in range(32)])
37 h.update(pw)
38 h.update(salt)
39 self.password = ("%s%s" % (h.hexdigest(), salt))
40
41 def isPasswordValid(self, pw):
42 if self.password is None:

Callers 1

__init__Method · 0.95

Calls 2

newMethod · 0.80
updateMethod · 0.45

Tested by

no test coverage detected