Last active
April 30, 2024 13:36
-
-
Save tiagoblackcode/1ad5e2475264591ffc2966ababa181f2 to your computer and use it in GitHub Desktop.
Generate RabbitMQ Password
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
#!/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