Skip to content

Commit 6e45311

Browse files
committed
* fix small Putflag bug
1 parent 36091bb commit 6e45311

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

checker/src/checker.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,12 @@ async def putflag_note(
351351

352352
retry = 0
353353

354-
while username == col_username and retry < 2:
354+
def username_normalform(username):
355+
letters = sorted([c for c in username if c.isalpha()])
356+
digits = sorted([c for c in username if c.isdigit()])
357+
return ''.join(letters) + ''.join(digits)
358+
359+
while username_normalform(username) == username_normalform(col_username) and retry < 3:
355360
username = rand_str(12)
356361
col_username = build_collision(username, alphabet=ALPHABET)
357362
retry += 1

0 commit comments

Comments
 (0)