Re:Ever wonder what the Wikipedia database schema looks like?
by Angostura on Wednesday January 21, 2009 @08:37AM
(#443181)
I'm not a database specialist, so I hope you will allow me to ask a daft question. Why, in the user table is the password held as a TinyBLOB. To allow for Unicode, or somesuch?
[ Parent
| on HN ]
Re:Ever wonder what the Wikipedia database schema looks like?
by Ezra on Thursday January 22, 2009 @03:36AM
(#444527)
In this case, the password field doesn't hold just a password, or a rot13 of a password, or even a digest of a password.
user_password is a concatenated md5 hash of user_id, a hyphen (-), and md5 hash of current password. ie. MD5(CONCAT(user_id, "-", MD5("PASSWORD")))
The reason for this is security, obviously.
The tinyblob then, is used for convenience/efficiency; it's a good way to store a hash. They might also do some tricks on the data (ie. convert to base 64 before it's stored, or something like that), but that's the general idea.