Last active
February 23, 2021 14:45
-
-
Save arobb/87f3a3d432734f2b9b7a99d9d952dc45 to your computer and use it in GitHub Desktop.
Generate random text
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Bash for macOS and Linux | |
LC_CTYPE=C tr -cd '[:alnum:]' < /dev/urandom | fold -w30 | head -n1 | |
# Python | |
import binascii, os | |
length=10 | |
binascii.b2a_hex(os.urandom(length)).decode('utf-8')[0:length] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment