MD5 hash with different results

前端 未结 4 448

Im trying to encode some chains to MD5 but I have noticed that:

For the chain: \"123456çñ\"

Some webs like

http://www.md5.net

www.md5.cz

4条回答
  •  温柔的废话
    2020-12-05 19:28

    If I try :

    echo "123456çñ
    "; echo "utf-8 : ".md5("123456çñ")."
    "; echo "ISO-8859-1 : ".md5(iconv("UTF-8", "ISO-8859-1","123456çñ"))."
    ";

    It gives the result :

    123456çñ
    utf-8 : 66f561bb6b68372213dd9768e55e1002
    ISO-8859-1 : 9e6c9a1eeb5e00fbf4a2cd6519e0cfcb
    

    The first website encode the string in ISO-8859-1 and the second in UTF-8.

提交回复
热议问题