kuda.ai

Thoughts on programming and music theory.

dark mode

Random AlphaNumeric Passwords

Created on April 16, 2026

commandline

I used random base64 to create passwords. But when using with postgres, it will require URL-encoding the string. Here is how to create a random password with just alphanumeric characters.

tr -dc 'A-Za-z0-9' < /dev/urandom | head -c 32

# or ...
openssl rand -base64 48 | tr -dc 'A-Za-z0-9' | head -c 32