mirror of
https://github.com/retspen/webvirtcloud
synced 2026-07-04 10:35:42 +00:00
Compare commits
2 commits
f620b88f73
...
bb31c09d25
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bb31c09d25 | ||
|
|
7bb5d6f313 |
1 changed files with 12 additions and 4 deletions
|
|
@ -1,5 +1,13 @@
|
||||||
import random
|
import secrets
|
||||||
import string
|
|
||||||
|
|
||||||
haystack = string.ascii_letters + string.digits + string.punctuation
|
generated_key = secrets.token_urlsafe(50)
|
||||||
print(''.join([random.SystemRandom().choice(haystack.replace('/', '').replace('\'', '').replace('\"', '')) for _ in range(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)]))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue