MD5_HMAC有什么用的?不明白!
<script language="c#" runat=server>
//by skyonline
//Date: 2003/6/3
//MD5 Function
string fun_MD5(string str)
{
byte[] b = System.Text.Encoding.GetEncoding(1252).GetBytes(str);
b=new System.Security.Cryptography.MD5CryptoServiceProvider().ComputeHash(b);
string ret="";
for(int i=0;i<b.Length;i++)
ret+=b[i].ToString("x").PadLeft(2,'0');
return ret;
}
Byte[] hexstr2array(string HexStr)
{
string HEX = "0123456789ABCDEF";
string str = HexStr.ToUpper();
int len = str.Length;
byte[] RetByte = new byte[len/2];
for(int i=0; i<len/2; i++)
{
int NumHigh = HEX.IndexOf(str[i*2]);
int NumLow = HEX.IndexOf(str[i*2+1]);
RetByte[i] = Convert.ToByte(NumHigh*16+NumLow);
}
return RetByte;
}
</script>