-
-
Save bergantine/1119284 to your computer and use it in GitHub Desktop.
| python -c "from random import choice; print ''.join([choice('abcdefghijklmnopqrstuvwxyz0123456789%^*(-_=+)') for i in range(32)])" |
For Python 3:
python -c "from random import choice; print(''.join([choice('abcdefghijklmnopqrstuvwxyz0123456789%^*(-_=+)') for i in range(32)]))"Seems that the link above was taken down, or is private.
i re-added the correct link for the gist.
Personally, i feel better if you changed this from from random import choice to from secrets import choice.
In the Docs, it says
The secrets module is used for generating cryptographically strong random numbers suitable for managing data such as passwords, account authentication, security tokens, and related secrets.
In particular, secrets should be used in preference to the default pseudo-random number generator in the random module, which is designed for modelling and simulation, not security or cryptography.
Long time ago. And its not correctly escaped.
python3 -c "from secrets import choice; print (''.join([choice('abcdefghijklmnopqrstuvwxyz0123456789%^*(-_=+)') for i in range(32)]))"
Updated for python 3.6
https://gist.github.com/urjeetpatel/60cee1e7dc509ead24e99f70de3b5bd7