I want to generate a 'Hash-Code' for a document and a photograph.
How do I do this please?
I want to generate a 'Hash-Code' for a document and a photograph.
How do I do this please?
At first choose the hashing algorithm you want to use. For example, md5, sha256, sha384, sha512 etc.
A point to note that, unless you are looking at cryptographic usage or where security is more important than complexity, md5 should be enough for regular file hashing that you want to crosscheck afterwards.
Now, GNU coreutils comes with most of the hash generating binaries for common algorithms:
% dpkg -L coreutils | grep '[0-9]sum$'
/usr/bin/sha224sum
/usr/bin/sha512sum
/usr/bin/md5sum
/usr/bin/sha1sum
/usr/bin/sha256sum
/usr/bin/sha384sum
Now pick the one of your choice, and do the sum e.g. for md5sum:
md5sum foobar.jpg
Replace foobar.jpg with the file of your choice to get the hash for that.
Also check the relevant man pages e.g. man md5sum.