Skip to content

Commit

Permalink
Added letter only code generation - #68
Browse files Browse the repository at this point in the history
Signed-off-by: LuXeZs <[email protected]>
  • Loading branch information
LuXeZs committed Jun 26, 2023
1 parent 7e17166 commit eaed50c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/lib/codegen.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ def genRandomCode(mode: str) -> str:
case 'backup':
# Generates an 8-digit alphanumeric 'backup' code
return list2str( list( next(genRandomChar( letters + digits )) for _ in range(8)))
case 'backup_let':
# Generates an 8-digit alphabetical 'backup' code
return list2str( list( next(genRandomChar( letters )) for _ in range(8)))
case 'both':
# Generates a code with a random possibility of being 'normal' or 'backup' type
# We pack the two genRandomCode options into a list, pass as a single parameter to randchoice
Expand Down

0 comments on commit eaed50c

Please sign in to comment.