Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
soitool
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
bachelor-paa-bittet
soitool
Commits
05b74acf
Commit
05b74acf
authored
5 years ago
by
morkolai
Browse files
Options
Downloads
Patches
Plain Diff
Cleanup soitool/coder.py
parent
cd5fa889
No related branches found
Branches containing commit
No related tags found
1 merge request
!52
#82 Cleanup
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
soitool/coder.py
+8
-6
8 additions, 6 deletions
soitool/coder.py
with
8 additions
and
6 deletions
soitool/coder.py
+
8
−
6
View file @
05b74acf
...
...
@@ -6,8 +6,7 @@ import secrets
def
get_code
(
code_length
,
mode
=
"
ascii
"
):
"""
Generate a single random code.
"""
Generate a single random code.
Parameters
----------
...
...
@@ -22,6 +21,11 @@ def get_code(code_length, mode="ascii"):
------
code : string
The code
Raises
------
ValueError
If mode param is neither of the accepted
"""
code
=
""
i
=
0
...
...
@@ -45,8 +49,7 @@ def get_code(code_length, mode="ascii"):
def
get_code_set
(
count
,
code_length
,
mode
=
"
ascii
"
):
"""
Generate a set of unique, random codes.
"""
Generate a set of unique, random codes.
Parameters
----------
...
...
@@ -74,8 +77,7 @@ def get_code_set(count, code_length, mode="ascii"):
def
get_code_length_needed
(
number_of_entries
):
"""
Get code length needed to support one unique code for each entry.
"""
Get code length needed to support one unique code for each entry.
Parameters
----------
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment