Skip to content

Instantly share code, notes, and snippets.

@tiagoblackcode
Last active April 30, 2024 13:36
Show Gist options
  • Save tiagoblackcode/1ad5e2475264591ffc2966ababa181f2 to your computer and use it in GitHub Desktop.
Save tiagoblackcode/1ad5e2475264591ffc2966ababa181f2 to your computer and use it in GitHub Desktop.
Generate RabbitMQ Password
#!/usr/bin/env bash
# reference: https://lists.rabbitmq.com/pipermail/rabbitmq-discuss/2011-May/012765.html
salt=$(openssl rand -hex 4 | xxd -r -p)
pass="hello"
hash=$(printf '%s%s' "$salt" "$pass" | shasum -a 256 | xxd -r -p)
printf '%s%s' "$salt" "$hash" | base64
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment