Skip to content

Instantly share code, notes, and snippets.

@nilium
Last active September 29, 2018 22:27
Show Gist options
  • Save nilium/145788068f89fad01194ca5bf164b912 to your computer and use it in GitHub Desktop.
Save nilium/145788068f89fad01194ca5bf164b912 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
args=()
while [ $# -gt 0 ]; do
case "$1" in
--) shift; break;;
-?*) :;;
-) break;;
*) break;;
esac
args=("${args[@]}" "$1")
shift
done
for fp; do
printf '%s %s\n' "$(shasum "${args[@]}" -- "$fp" | awk '{print $1}' | xxd -r -p | zbase32-encode)" "$fp"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment