Here is my breakdown:
- If you use strings instead of binary, use a fixed length field. Since the hashing algos all output a fixed length you can save yourself some space there.
- Since you are only doing an equality comparison, there is no need for indexes. Binary fields have no collation type or character set.
- BINARY column types have no odd storage caveats like BLOBs do.
- Each hexadecimal character represents 4 bits in the 8 (or 7) bits it consumes. This means that binary storage is twice as efficient.
- MOST IMPORTANT: Unless you are working in an embedded system where each byte counts, don't do it. Having a character representation will allow you better debugging. Plus, every time a developer is working a problem like this I have to wonder why. Every architectural decision like this has trade-offs and this one does not seem like it adds value to your project.
- You can always convert to BINARY later with a simple SQL script.
In short, use a fixed length text field. There is no gain to counting bytes in the current world, especially when change is easy to achieve.
Hope this helps.