I cover how to do that in the link above, but to quickly do this, run the following command on both folder paths:
find -s ~/Downloads -type f -exec md5 -q {} \; | md5
This will generate a list of md5 checksums for each file in the directory (in this case, the Downloads directory in your home folder, but you can change this to whatever you would like), and then create a summary checksum of the collective checksums.
In my case, the above command yields the following checksum:
42cf9632cf763cad84c633f0cc7c93bb
Doing this on my Documents folder yields the following checksum:
782845544f0ecf8a7ae5fa66197d6abd
You can then compare these to see if they are different. In this case they are, indicating the folders do not have the same contents.
Keep in mind this may take a while to run, as checksums will have to be computed for each file in the directory. While this is a raw command, you can save it in a script and then simply run the script with an input argument to make it easier. For example, the following script should work:
#!/bin/bash
find -s $1 -type f -exec md5 -q {} \; | md5
Saving this in a text file, naming it something like "dirsum" and then making it executable in a path location such sa /bin (or a custom added path) will make it easily accessible, so you can run the same command by simply typing the following in the Terminal (in this case to calculate a checksum of the Downloads folder):
dirsum ~/Downloads