2022-02-09
Every few months, I find myself needing to generate random strings for identifiers, passwords, tokens, and other purposes. Here's what I've been relying on:
# Generate hexidecimal string
openssl rand -hex 32
# 421b8623f2dd6d9765ebfac6905caa070bb2853185c85d14c3c069cb08986c8e
# Generate base32 string
openssl rand -base64 32
# tRCbaVbHWTuUzd5Ag7NDaQrPGI5G/2Ui5KZ5Vc6qGqk=
# Generate a UUID
uuidgen
# f080bfcc-ed62-4453-82b2-cd6f2f958870