Jump to content
Larry Ullman's Book Forums

Database Sql Knowledge Is Power

Recommended Posts

Dude. Stop making new threads like these. ;)


A thread should have discussion potential, or at least be a question, not just stating information. If you asked for other peoples tricks/secrets/etc, there would be discussion potential, but there's really non here. This would be a viable post in a general DB/mysql thread, but not a thread in itself.

  • Upvote 1
Link to comment
Share on other sites

My post was merely meant to help you. Sorry if you feel stepped on.


The problem is; how does this thread spark discussion? How does it enable me to be a participant in the conversation? Good threads always makes this possible. They have a defined topic that lets users discuss and exchange experiences.


You can share your experiences, but broaden the topic and let others contribute to the thread. You'll see you'll get much more replies on your threads this way. And that's kind of the point, right? Creating discussions? ;)


Just my two cents.

  • Upvote 2
Link to comment
Share on other sites

So does anyone know why a sha256 needs 64 characters to store in the database as VARBINARY? And 32 is not enough?


How many Varbinary would we also need if we wanted to store a SHA512 so i can compare your reasoning, anyone have any insights on this one?

Link to comment
Share on other sites

Make a script of this. It will allow you to see hash lengths for all hashes.



$data = "password";

foreach (hash_algos() as $v)
       $r = hash($v, $data, false);
       printf("%-12s %3d %s\n", $v, strlen($r), $r);




sha512 requires 512 chars for hashes. You may notice this is the double of sha256. 32 chars for sha256 is simply not enough as it produces larger hashes. More than that, I don't know.

Link to comment
Share on other sites


  • Create New...