|
69 | 69 | # bcrypt is currently the recommended algorithm. |
70 | 70 |
|
71 | 71 | import os |
72 | | -import sys |
73 | 72 |
|
74 | 73 | from hashlib import md5 |
75 | | -from time import sleep |
76 | 74 |
|
77 | 75 |
|
78 | 76 | def to64(data, n_out): |
@@ -146,13 +144,12 @@ def hash_apr1(salt, password): |
146 | 144 |
|
147 | 145 | pw_ascii = ( |
148 | 146 | to64(mkint(final, 0, 6, 12), 4) |
149 | | - + to64(mkint(final, 1, 7, 13), 4) |
150 | | - + to64(mkint(final, 2, 8, 14), 4) |
151 | | - + to64(mkint(final, 3, 9, 15), 4) |
152 | | - + to64(mkint(final, 4, 10, 5), 4) |
153 | | - + to64(mkint(final, 11), 2) |
| 147 | + + to64(mkint(final, 1, 7, 13), 4) # noqa: W503 |
| 148 | + + to64(mkint(final, 2, 8, 14), 4) # noqa: W503 |
| 149 | + + to64(mkint(final, 3, 9, 15), 4) # noqa: W503 |
| 150 | + + to64(mkint(final, 4, 10, 5), 4) # noqa: W503 |
| 151 | + + to64(mkint(final, 11), 2) # noqa: W503 |
154 | 152 | ) |
155 | | - |
156 | 153 | return "$apr1$%s$%s" % (salt, pw_ascii) |
157 | 154 |
|
158 | 155 |
|
|
0 commit comments