Skip to content

Instantly share code, notes, and snippets.

@LightningStalker
Created June 12, 2024 03:41
Show Gist options
  • Select an option

  • Save LightningStalker/3a6f0a5b855aa0a39efac1cead58fd20 to your computer and use it in GitHub Desktop.

Select an option

Save LightningStalker/3a6f0a5b855aa0a39efac1cead58fd20 to your computer and use it in GitHub Desktop.
#!/bin/bash
# script that reads a YAML (.yml) file and verifies a local file against its sha512 hash
# extraction of multiple digest entries not supported
# these .yml are rumored to be spawn of electron-builder or ...
hash=$(sed -n 's/^sha512: //p' $1 | base64 -d | xxd -p -c64)
fname=$(sed -n 's/path: //p' $1)
echo -n $hash' '$fname | sha512sum -c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment