Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 12-17-2008, 06:27 AM   PM User | #1
Joseph Witchard
Regular Coder

 
Join Date: Oct 2008
Posts: 255
Thanks: 113
Thanked 0 Times in 0 Posts
Joseph Witchard is an unknown quantity at this point
md5 Info

Is there like a chart somewhere that shows how long a string becomes after performing md5() on it, based on the length of the original string?

Last edited by Joseph Witchard; 12-19-2008 at 01:52 AM..
Joseph Witchard is offline   Reply With Quote
Old 12-17-2008, 06:45 AM   PM User | #2
abduraooft
Supreme Master coder!

 
abduraooft's Avatar
 
Join Date: Mar 2007
Location: N/A
Posts: 14,680
Thanks: 158
Thanked 2,182 Times in 2,169 Posts
abduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really nice
Check the manual
Quote:
Originally Posted by http://php.net/md5
Return Values

Returns the hash as a 32-character hexadecimal number.
__________________
Quote:
The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)
abduraooft is offline   Reply With Quote
Users who have thanked abduraooft for this post:
Joseph Witchard (12-19-2008)
Old 12-17-2008, 06:55 AM   PM User | #3
Joseph Witchard
Regular Coder

 
Join Date: Oct 2008
Posts: 255
Thanks: 113
Thanked 0 Times in 0 Posts
Joseph Witchard is an unknown quantity at this point
I'm sorry, didn't see that when I checked the manual. So the length will always be 32 characters?
Joseph Witchard is offline   Reply With Quote
Old 12-17-2008, 07:14 AM   PM User | #4
194673
Regular Coder

 
Join Date: Dec 2006
Posts: 166
Thanks: 9
Thanked 4 Times in 4 Posts
194673 is an unknown quantity at this point
Yes, it will always be 32 characters in length.
194673 is offline   Reply With Quote
Users who have thanked 194673 for this post:
Joseph Witchard (12-19-2008)
Old 12-17-2008, 07:26 AM   PM User | #5
Joseph Witchard
Regular Coder

 
Join Date: Oct 2008
Posts: 255
Thanks: 113
Thanked 0 Times in 0 Posts
Joseph Witchard is an unknown quantity at this point
So would a user registration form that had it's password input maxlength property set to 20, and the password field in the MySQL table set to varchar with a length of 32 work?

Sorry about all the questions. I messed up my login script tonight, and it took me awhile to figure out it was because I had changed the password length in the database.
Joseph Witchard is offline   Reply With Quote
Old 12-17-2008, 07:30 AM   PM User | #6
abduraooft
Supreme Master coder!

 
abduraooft's Avatar
 
Join Date: Mar 2007
Location: N/A
Posts: 14,680
Thanks: 158
Thanked 2,182 Times in 2,169 Posts
abduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really nice
Quote:
So would a user registration form that had it's password input maxlength property set to 20, and the password field in the MySQL table set to varchar with a length of 32 work?
Yes, the output character length is independent of the input character length.
__________________
Quote:
The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)
abduraooft is offline   Reply With Quote
Users who have thanked abduraooft for this post:
Joseph Witchard (12-19-2008)
Old 12-19-2008, 01:52 AM   PM User | #7
Joseph Witchard
Regular Coder

 
Join Date: Oct 2008
Posts: 255
Thanks: 113
Thanked 0 Times in 0 Posts
Joseph Witchard is an unknown quantity at this point
Thanks!
Joseph Witchard is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 05:06 PM.


Advertisement
Log in to turn off these ads.