Backend implementation for random passwords
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing

This commit is contained in:
cami 2021-07-16 04:00:01 +02:00
parent c9e987a28f
commit f64406c74b

View file

@ -0,0 +1,51 @@
from random import seed
from random import randint
import time
seed(int(time.time()))
def get_random_value(list_length):
random_select = randint(0, list_length)
return random_select
def get_password():
first_part = [
"Der Vogel",
"Die Ameise",
"Die Biene",
"Ein Mensch",
"Jemand",
]
second_part = [
"frisst",
"küsst",
"begrüsst",
]
third_part = [
"den Vogel",
"die Mücke",
"den Adler",
"den Apfel",
"die Birne",
"die Biene",
"eine Gurke",
]
forth_part = [
"auf der Terasse.",
"auf der Wiese.",
"im Garten.",
"in der Kühltruhe.",
]
password = ""
password += str(first_part[get_random_value(len(first_part)-1)])
password += " " + str(second_part[get_random_value(len(second_part)-1)])
password += " " + str(third_part[get_random_value(len(third_part)-1)])
password += " " + str(forth_part[get_random_value(len(forth_part)-1)])
return password