sha1 column type

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

I have read several online tutorials advocating storing a sha1() hashed  
password in a column of type BLOB.  As far as I can tell, sha1() always  
returns a string of 40 characters, regardless of the size of the  
original input.  Is there any reason I can't store this as type CHAR?  I  
am running MySQL 4.1.x.  Thanks in advance.

Re: sha1 column type

Marcus wrote:
Quoted text here. Click to load it

A fixed-length string that is always right-padded with spaces to the
specified length when stored. M represents the column length. The range of M
is 0 to 255 characters.

Should be possible without any problems...

Rik Wasmus

Re: sha1 column type

Quoted text here. Click to load it

 SHA1 produces a 20-byte hash, for which you could use BLOB, which can also be
represented as a 40-byte hexadecimal string, for which you can use a character

Andy Hassall :: :: :: disk and FTP usage analysis tool

Site Timeline