0

这是代码请帮助我谢谢

    public static string CalculateMD5Hash(string strInput)
    {
        MD5 md5 = System.Security.Cryptography.MD5.Create();
        byte[] inputBytes = System.Text.Encoding.ASCII.GetBytes(strInput);
        byte[] hash = md5.ComputeHash(inputBytes);

        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < hash.Length; i++)
        {
            sb.Append(hash[i].ToString("x2"));
        }
        return sb.ToString();
    }
4

1 回答 1

1

您可以使用md5()

喜欢

<?php
    function CalculateMD5Hash($strInput){
       return md5($strInput);
    }
?>
于 2013-07-17T05:29:32.423 回答