IsaacKerson commited on
Commit
e8cbd34
1 Parent(s): 6a3c717

update Hasher class

Browse files
Files changed (1) hide show
  1. 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, passwords):
10
  """Create a new instance of "Hasher".
11
  Parameters
12
  ----------
13
- passwords: list
14
- The list of plain text passwords to be hashed.
15
  Returns
16
  -------
17
- list
18
- The list of hashed passwords.
19
  """
20
- self.passwords = passwords
21
 
22
  def hash(self, password):
23
  """
@@ -36,14 +36,10 @@ class Hasher:
36
  """
37
  Returns
38
  -------
39
- list
40
- The list of hashed passwords.
41
  """
42
- hashedpw = []
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):