MCPcopy Create free account
hub / github.com/simple-login/app / random_string

Function random_string

app/utils.py:41–47  ·  view source on GitHub ↗

Generate a random string of fixed length

(length=10, include_digits=False)

Source from the content-addressed store, hash-verified

39
40
41def random_string(length=10, include_digits=False):
42 """Generate a random string of fixed length"""
43 letters = string.ascii_lowercase
44 if include_digits:
45 letters += string.digits
46
47 return "".join(secrets.choice(letters) for _ in range(length))
48
49
50_ALLOWED_CHARS = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-."

Callers 15

reset_user_passwordFunction · 0.90
generate_reply_emailFunction · 0.90
generate_oauth_client_idFunction · 0.90
create_newMethod · 0.90
create_newMethod · 0.90
createMethod · 0.90
createMethod · 0.90
generateMethod · 0.90
generateMethod · 0.90
processMethod · 0.90

Calls

no outgoing calls