回答編集履歴

1

コメントの指摘の通りに変更

2017/09/20 11:48

投稿

YouheiSakurai
YouheiSakurai

スコア6142

test CHANGED
@@ -1,6 +1,18 @@
1
1
  ```
2
2
 
3
+ class AuthManager:
4
+
5
+ def login(self, username, password):
6
+
7
+ username = hash(username)
8
+
9
+ password = hash(password)
10
+
3
- './users'
11
+ with open('./users', 'rt') as f:
12
+
13
+ for line in f:
14
+
15
+ check(username, password)
4
16
 
5
17
  ```
6
18
 
@@ -14,10 +26,28 @@
14
26
 
15
27
  from os.path import dirname, join
16
28
 
29
+
30
+
31
+ class AuthManager:
32
+
33
+ def login(self, username, password):
34
+
35
+ username = hash(username)
36
+
37
+ password = hash(password)
38
+
17
- join(dirname(__file__), 'users')
39
+ with open(join(dirname(__file__), 'users'), 'rt') as f:
40
+
41
+ for line in f:
42
+
43
+ check(username, password)
18
44
 
19
45
  ```
20
46
 
21
47
 
22
48
 
23
49
  とする方が良いと思います。
50
+
51
+
52
+
53
+ コメントの指摘を受けて回答内容を変更しました。