Convert checksum between Hex and Base64 using CLI

Checksums produced by SHA1, SHA2 are usually in hex format. However, there also come in base64. I just discovered a way to convert between the two.

Convert checksum between Hex and Base64 using CLI

From Hex to Base64

$> echo "da3968197e7bf67aa45a77515b52ba2710c5fc34" | xxd -r -p | base64
2jloGX579nqkWndRW1K6JxDF/DQ=

From Base64 to Hex

# Found on https://stephenhirst.azurewebsites.net/?p=5582
$> echo "2jloGX579nqkWndRW1K6JxDF/DQ=" | base64 -d | hexdump -v -e '/1 "%02x" '
Gist