SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Evangelist ckchin's Avatar
    Join Date
    Mar 2002
    Location
    msia
    Posts
    487
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    What is the maximum length of md5

    What is the maximum length of md5?

    Let say I want to md5 (11111) 5 characters, it has 16 charccters (64cfb65039a793cf), and I found out that if I md5 more characters, the more md5ed characters I will get.

    Then, my question is that...do you think there is an maximum length of md5-ed characters?

    Thanks in advance.

  2. #2
    Making a better wheel silver trophy DR_LaRRY_PEpPeR's Avatar
    Join Date
    Jul 2001
    Location
    Missouri
    Posts
    3,428
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    you're talking about what md5() returns? something's not right then. md5() should always return a 32 character hash.

    PHP Code:
    echo md5('anything you want'); 
    and you should always get 32 characters, no matter what length of text you pass as a parameter.
    - Matt ** Ignore old signature for now... **
    Dr.BB - Highly optimized to be 2-3x faster than the "Big 3."
    "Do not enclose numeric values in quotes -- that is very non-standard and will only work on MySQL." - MattR

  3. #3
    SitePoint Evangelist ckchin's Avatar
    Join Date
    Mar 2002
    Location
    msia
    Posts
    487
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks. I wrongly saw the password function of Mysql.

    If md5 return 32 charcters,

    how about password function in MySQL? Does it depends on the length of not yet "password-ed' charcaters' length?

    I experienced it does, so does it have maximum length? or just depends on the length of not yet "password-ed' charcaters?

    I need to make my length of fields (in mySQL database) to handle this.

  4. #4
    Making a better wheel silver trophy DR_LaRRY_PEpPeR's Avatar
    Join Date
    Jul 2001
    Location
    Missouri
    Posts
    3,428
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    sorry, can't answer that. i don't use PASSWORD() in MySQL because md5() is more of a standard function that i can use in MySQL or PHP. and since it returns 32 chars, i just store it in a CHAR(32) column.

    anyone know about PASSWORD()?

  5. #5
    SitePoint Evangelist ckchin's Avatar
    Join Date
    Mar 2002
    Location
    msia
    Posts
    487
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks DR_LaRRY_PEpPeR,

    I think I need to change all my password field to char(32) and user md5 instead.

    Thanks.
    Last edited by ckchin; May 3, 2002 at 01:41.

  6. #6
    SitePoint Enthusiast
    Join Date
    May 2001
    Location
    lalal
    Posts
    85
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    password() is 16 chars

  7. #7
    SitePoint Evangelist ckchin's Avatar
    Join Date
    Mar 2002
    Location
    msia
    Posts
    487
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for information.

    I found that mysql quite strange because I tried to set my password field to char(32) and it automatically change mine back to varchar(32) which initially is varchar(18) when I use the password() from Mysql.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •