网上很多都是国外人写的,所以不支持中文。
我想了很多办法把中文的双字节变成字节流,也没搞定,麻烦高手给个算法,效果跟php的结果一样。 谢谢。

解决方案 »

  1.   

    http://pajhome.org.uk/crypt/md5/md5.js经测试,与MD5网站http://www.cmd5.com/得到的MD5值完全一致<html> 
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> 
    <title>测试</title> 
    </head> 
    <body> 
    <script type="text/javascript" src="md5.js"></script>
    <button onclick="fun()">测试</button>
    <script type="text/javascript">
    function fun()
    {
    alert( hex_md5("你好") );
    }
    </script> 
    </body> 
    </html> 
      

  2.   

    关键是http://www.cmd5.com的结果是否正确。'你好'的MD5码应该是b94ae3c6d892b29cf48d9bea819b27b9
      

  3.   

    最近文这个的人好多啊
    http://pajhome.org.uk/crypt/md5/index.html
    MD5不区分中文的