Skip to content

Commit 11772f8

Browse files
committed
* Performance Optimization: Hashing
1 parent 4500bb1 commit 11772f8

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

checker/src/checker.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,7 @@ async def putflag_note(
358358
col_username = build_collision(username, alphabet=ALPHABET)
359359
if username_normalform(username) != username_normalform(col_username):
360360
break
361+
logger.info(f"[putflag] Username: {username} collision={col_username}")
361362

362363
try:
363364
token = await con.register_and_login(username, password)

service/backend/auth.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
ALGORITHM = "HS256"
88
ACCESS_TOKEN_EXPIRE_MINUTES = 30
99

10-
pwd_context = CryptContext(schemes=["bcrypt"], deprecated="auto")
10+
pwd_context = CryptContext(schemes=["sha256_crypt"], deprecated="auto")
1111

1212

1313
def verify_password(plain_password, hashed_password):

service/backend/gunicorn.conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import multiprocessing
22

33
worker_class = "uvicorn.workers.UvicornWorker"
4-
workers = min(4, multiprocessing.cpu_count())
4+
workers = 2
55
bind = "0.0.0.0:2626"
66
timeout = 90
77
keepalive = 3600

0 commit comments

Comments
 (0)