Using the shasum utility on macOS to calculate the sha512 hash of a file on macOS
shasum -a 512 <filename>
Using OpenSSL to calculate the sha512 hash using binary input
openssl dgst -sha512 -binary <filename> | openssl base64 -A
Example:
openssl dgst -sha512 -binary draw.io-13.9.9.dmg | openssl base64 -A