MCPcopy Index your code
hub / github.com/PySimpleGUI/PySimpleGUI / PasswordMatches

Function PasswordMatches

DemoPrograms/Demo_Password_Login.py:56–61  ·  view source on GitHub ↗
(password, a_hash)

Source from the content-addressed store, hash-verified

54 # ----------------------------- Paste this code into your program / script -----------------------------
55 # determine if a password matches the secret password by comparing SHA1 hash codes
56 def PasswordMatches(password, a_hash):
57 password_utf = password.encode('utf-8')
58 sha1hash = hashlib.sha1()
59 sha1hash.update(password_utf)
60 password_hash = sha1hash.hexdigest()
61 return password_hash == a_hash
62
63 login_password_hash = '6adfb183a4a2c94a2f92dab5ade762a47889a5a1' # helloworld
64 password = sg.popup_get_text(

Callers 1

mainFunction · 0.85

Calls 1

updateMethod · 0.45

Tested by

no test coverage detected