how to checksum on file/folder

hi all,

how do you do a checksum of a file folder, i want to use sha512 as md5 is cracked

file -

sha512 path/to/file/file.tar

folder -

find -s path/to/folder -type f -exec sha512 {} \; | sha512

many thanks,

Just a small note. I think you're confusing things here.

MD5 shouldn't be used for password hashing because it's unsalted and vulnerable to collision attacks. But it's still fine to use it for basic file integrity checks.
Being less computationally expensive than other algorithms such as SHA512 also makes it easier to crack (when used in a cryptographic system). And this is precisely the same reason it's more interesting for basic file integrity checks compared to the rest. You'll notice the difference when you want to generate checksums for thousands of files.
wow, wasnt expecting this, im getting all different checksum values

i think i will extract the tar and cross reference it with the source directory ie do on both

count number of files

size of directory

SHA512 (/vol/cha-work/_ARCHIVE/to_be_archived/audio/chad_r/2017-05-17/Even When I Fall - January 2017 Project.tar) = fa8a0c210f4616f27de9e66d5316bce62881baf794214ebecbf4a6fd576e09b274b278f0bef278315e12159083073975f02e5f03aff18682e5273722287df799

find -s /vol/cha-work/_ARCHIVE/to_be_archived/audio/chad_r/2017-05-17/Even\ When\ I\ Fall\ -\ January\ 2017\ Project/ -type f -exec sha512 {} \; | sha512

tar -cf - Even\ When\ I\ Fall\ -\ January\ 2017\ Project/ | sha512