Last active
August 15, 2024 06:38
-
-
Save ObjectBoxPC/c80fce7fc242fce195ae42f4edafff6f to your computer and use it in GitHub Desktop.
Quickly generate random passwords using built-in utilities (emulating Python's secrets.token_urlsafe: https://gist.github.com/ObjectBoxPC/89206ca79bb26fdc2112233ede121d9d )
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
#!/bin/sh | |
ENTROPY_BYTES=16 | |
dd if=/dev/urandom bs="$ENTROPY_BYTES" count=1 2> /dev/null | \ | |
base64 -w 0 | sed 's/=//g; s/+/-/g; s/\//_/g' | |
echo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment