@allquixotic's answer does not generate same hashes on the different machines that will not help us to verify and have consistent hashes for the folder.
Reason:
The output contains <hash> along with <file path>; which file path may differ on different machines and will cause to generate different hash values on different machines.
Example:
hello_mars.txt contains mars text and hello_world.txt contains world text.
$ pwd
/Users/alper/example
$ ls
hello_mars.txt hello_world.txt
$ find . -type f \( -exec sha1sum "$PWD"/{} \; \)
9591818c07e900db7e1e0bc4b884c945e6a61b24 /Users/alper/example/./hello_world.txt
02c13f3652546c74a71ae352e8ff0f87a90101b3 /Users/alper/example/./hello_mars.txt
$ find . -type f \( -exec sha1sum "$PWD"/{} \; \) | sha1sum
a540b4f1b74e1fe19f25c366a44088bec266d68b -
Now I rename the folder from example to example_1:
$ pwd
/Users/alper/example_1
$ ls
hello_mars.txt hello_world.txt
$ find . -type f \( -exec sha1sum "$PWD"/{} \; \)
9591818c07e900db7e1e0bc4b884c945e6a61b24 /Users/alper/example_1/./hello_world.txt
02c13f3652546c74a71ae352e8ff0f87a90101b3 /Users/alper/example_1/./hello_mars.txt
$ find . -type f \( -exec sha1sum "$PWD"/{} \; \) | sha1sum
b3248c8fd2283788d57c5d774baf895e853ddce4 -
As you can see now generated hash is different from the previous one.
Correct command should be as follows, which will generate same output indepented from the folder's path:
find . -type f \( -exec sha1sum "$PWD"/{} \; \) | awk '{print $1}' | sort | sha1sum
please note that you can also use md5sum instead of sha1sum.
$ pwd
/Users/alper/example
$ ls
hello_mars.txt hello_world.txt
$ find . -type f \( -exec sha1sum "$PWD"/{} \; \) | awk '{print $1}' | sort
02c13f3652546c74a71ae352e8ff0f87a90101b3
9591818c07e900db7e1e0bc4b884c945e6a61b24
$ find . -type f \( -exec sha1sum "$PWD"/{} \; \) | awk '{print $1}' | sort | sha1sum
e0dcb7c2fbdbd83ece5223cf48796fbdfb0ad68d -
Hence the path would be different on different machines. awk '{print $1}' will help us the obtain the first column, which has only the hash of the files. Later we need to sort those hashes, where the order might be different on different machines, which may also cause us to have different hashes if there are more than two files.