Generating a base64 encoded SHA512 digest for a file (or set of files)?

You can shorten your command by combining some things: openssl dgst -sha512 -binary IMG_0999. Gif | openssl enc -base64 | tr '+/' '-_' | tr -d '=\n For all files in a tree, something like: find . -type f -name '*.

Gif' -print0 | xargs -0 -I % sh -c 'openssl dgst -sha512 -binary "$(basename "$1")" | openssl enc -base64 | tr "+/" "-_" | tr -d "=\n" > "$1. Sum"' _ $1.

You can shorten your command by combining some things: openssl dgst -sha512 -binary IMG_0999. Gif | openssl enc -base64 | tr '+/' '-_' | tr -d '=\n' For all files in a tree, something like: find . -type f -name '*.

Gif' -print0 | xargs -0 -I % sh -c 'openssl dgst -sha512 -binary "$(basename "$1")" | openssl enc -base64 | tr "+/" "-_" | tr -d "=\n" > "$1. Sum"' _ $1.

Dennis Williamson's solution got me going but the tr version (2.0) that is installed did like that multiple character syntax. Also, the xargs version (4.1) didn't like the -I option. However, it got me started and that is what matters.

Here is what I ended up with: find . -type f -name '*. Gif' -print0 | xargs -0 --replace=% sh -c 'echo -e "Archive-Asset-Name: %\nArchive-Asset-SHA-512-Digest: `openssl dgst -sha512 -binary % | openssl enc -base64 | tr "+" "-" | tr "/" "_" | tr -d "=" | tr -d "\n"`\n"' and that generates the following (images names changed to protect the innocent) Archive-Asset-Name: .

/IMG_0001. Gif Archive-Asset-SHA-512-Digest: AsgQnXYxj07qy-DTlzqYEv3v1UNqbr1sp5kVz0PE8FYwD-q_0VM20Wyci3xunJwdqy59MbyIX1GGtSmhuETUHQ Archive-Asset-Name: . /IMG_0032.

Gif Archive-Asset-SHA-512-Digest: JE3lmvXxOjSpDoUjyvAp92E1T4b8AQGGJBCcBz_1AG2eoBoSRH76LHpWPEUAeXFx_kOqEaDMRGPrpYnlfcnz9g Archive-Asset-Name: . /IMG_0003. Gif Archive-Asset-SHA-512-Digest: bJJQ-j-s9630FzUh3hP50h7gWYqJQ6o0FP37nUuSeSUmerFxBwR2X0VeTYn-h4cf7szUr4fqDfAKQLOK0gt7zA I still need to tweak the name to not be prefixed with .

/ but that is for another day.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions