expephalon-kumisms/smsotp/helpers.py

6 lines
211 B
Python
Raw Normal View History

from dbsettings.functions import getValue
import random
def generate_token(len=getValue("smsotp.length", 6), chars=getValue("smsotp.chars", "0123456789")):
return "".join(random.choices(chars, k=int(len)))