20 lines
665 B
Python
20 lines
665 B
Python
import string
|
|
import random
|
|
import uuid
|
|
|
|
|
|
def generate_validation_name(validation_type: str = "Request") -> str:
|
|
"""
|
|
Generate a validation name based on the current date and time.
|
|
"""
|
|
list_of_alphabet = list(string.ascii_lowercase)
|
|
base_uuids = str(uuid.uuid4()) * 2
|
|
result_string_list = []
|
|
for base_uuid in base_uuids:
|
|
if str(base_uuid).lower() not in list_of_alphabet:
|
|
result_string_list.append(str(random.choice(list_of_alphabet)).upper())
|
|
else:
|
|
result_string_list.append(base_uuid.upper())
|
|
result_string = "".join(result_string_list)
|
|
return f"{validation_type.upper()}{result_string}"
|