mirror of
https://github.com/retspen/webvirtcloud
synced 2024-12-25 15:45:23 +00:00
13 lines
365 B
Python
13 lines
365 B
Python
import secrets
|
|
|
|
generated_key = secrets.token_urlsafe(50)
|
|
|
|
print(''.join(generated_key))
|
|
|
|
|
|
### Use for old python versions < 3.6
|
|
##import random
|
|
##import string
|
|
#
|
|
##haystack = string.ascii_letters + string.digits + string.punctuation
|
|
##print(''.join([random.SystemRandom().choice(haystack.replace('/', '').replace('\'', '').replace('\"', '')) for _ in range(50)]))
|