任何帮助都会很棒! 感谢
buf[0] = (num1 & 0xff000000) >> 24;
buf[1] = (num1 & 0xff0000) >> 16;
buf[2] = (num1 & 0xff00) >> 8;
buf[3] = num1 & 0xff;
buf[4] = (num2 & 0xff000000) >> 24;
buf[5] = (num2 & 0xff0000) >> 16;
buf[6] = (num2 & 0xff00) >> 8;
buf[7] = num2 & 0xff;
strncpy(buf+8, headers->key3, 8);
buf[16] = '\0';
md5_buffer(buf, 16, target);
target[16] = '\0';
答案 0 :(得分:3)
byte[] temp1 = BitConvert.GetBytes(num1);
byte[] temp2 = BitConvert.GetBytes(num2);
Array.Copy(temp1, 0, buf, 0, 4);
Array.Copy(temp2, 0, buf, 4, 4);
Array.Copy(buf, 8, headers.key3, 0, 8)
buf[16] = 0;
Array.Copy(buf, target, 16)
target[16] = 0;
Using MD5 hasher = new MD5CryptoServiceProvider()
target = hasher.ComputeHash(buf);
End Using