Spaces:
Runtime error
Runtime error
IsaacKerson
commited on
Commit
•
e8cbd34
1
Parent(s):
6a3c717
update Hasher class
Browse files- authenticator.py +9 -13
authenticator.py
CHANGED
@@ -6,18 +6,18 @@ from datetime import datetime, timedelta
|
|
6 |
import extra_streamlit_components as stx
|
7 |
|
8 |
class Hasher:
|
9 |
-
def __init__(self,
|
10 |
"""Create a new instance of "Hasher".
|
11 |
Parameters
|
12 |
----------
|
13 |
-
|
14 |
-
|
15 |
Returns
|
16 |
-------
|
17 |
-
|
18 |
-
|
19 |
"""
|
20 |
-
self.
|
21 |
|
22 |
def hash(self, password):
|
23 |
"""
|
@@ -36,14 +36,10 @@ class Hasher:
|
|
36 |
"""
|
37 |
Returns
|
38 |
-------
|
39 |
-
|
40 |
-
The
|
41 |
"""
|
42 |
-
|
43 |
-
|
44 |
-
for password in self.passwords:
|
45 |
-
hashedpw.append(self.hash(password))
|
46 |
-
return hashedpw
|
47 |
|
48 |
class Authenticate:
|
49 |
def __init__(self, names, usernames, passwords, cookie_name, key, cookie_expiry_days=30):
|
|
|
6 |
import extra_streamlit_components as stx
|
7 |
|
8 |
class Hasher:
|
9 |
+
def __init__(self, password):
|
10 |
"""Create a new instance of "Hasher".
|
11 |
Parameters
|
12 |
----------
|
13 |
+
password: str
|
14 |
+
Plain text password to be hashed.
|
15 |
Returns
|
16 |
-------
|
17 |
+
str
|
18 |
+
Plain text password to be hashed.
|
19 |
"""
|
20 |
+
self.password = password
|
21 |
|
22 |
def hash(self, password):
|
23 |
"""
|
|
|
36 |
"""
|
37 |
Returns
|
38 |
-------
|
39 |
+
str
|
40 |
+
The hashed password.
|
41 |
"""
|
42 |
+
return self.hash(password)
|
|
|
|
|
|
|
|
|
43 |
|
44 |
class Authenticate:
|
45 |
def __init__(self, names, usernames, passwords, cookie_name, key, cookie_expiry_days=30):
|