MySQL Hashing Function Implementation

前端 未结 7 1627
[愿得一人]
[愿得一人] 2020-12-05 03:31

I know that php has md5(), sha1(), and the hash() functions, but I want to create a hash using the MySQL PASSWORD() function. So far, the only way I can think of is to just

相关标签:
7条回答
  • 2020-12-05 04:06

    Yes, too late but I just came up this implementation on that page: http://dev.mysql.com/doc/refman/5.1/en/password-hashing.html

    Here is the equivalent php function to mysql password;

    function mysql_41_password($in) {
        $p = sha1($in, true);
        $p = sha1($p);
        return '*'. strtoupper($p);
    } 
    
    0 讨论(0)
提交回复
热议问题