How to generate argon2id hash on the command line using argon2

Use the following command to generate an argon2id hash on the command line using argon2 and a random salt:

echo -n 'your_password' | argon2 $(openssl rand -base64 16) -id -e

Example output

$argon2id$v=19$m=4096,t=3,p=1$ekQ0Qi9UcVBFVmdxTldMTklhUlZPUT09$NINhlCVSg3Py0qfmGotyns5KWXt+HwUciPRa1BUS9ao