So I've never actually done this, I kind of just thought of this after reading your question, but I think it would go something like this.
1. Use "diskutil list" to get the disk identifier for the flash drive when its plugged in, it'll be something like /dev/disk2 for the whole disk, or /dev/disk2s2 for the partition. In theory you only need to use the partition not the whole disk.
2. Make a dmg on your machine locally by doing "sudo dd if=/dev/disk2s2 of=~/Desktop/InstallerA.dmg" for the first drive, then maybe the same command but use "InstallerB.dmg" for the next one and so on. Replace disk2s2 with whatever you are finding is the identifier in your case.
3. Since MD5 checksum should be adequate for your purpose, use "openssl md5 ~/Desktop/InstallerA.dmg" to get its MD5 hash. If you want you can also do sha256 or something. Then just compare the hashes.
Also, might I ask, what are you ultimately trying to achieve? Do you have reason to believe that multiple installers made from the same installer app aren't equal? Let me know how this works, and as always, be careful using sudo and dd together.