110,561
社区成员
发帖
与我相关
我的任务
分享
return BitConverter.ToString(encryptedData).Replace("-", "");
public static byte[] HexToBytes(string Hex)
{
int num = (int) Math.Round((double) (((double) Hex.Length) / 2));
byte[] buffer = new byte[(num - 1) + 1];
int num3 = num - 1;
for (int i = 0; i <= num3; i++)
{
string s = Hex.Substring(i * 2, 2);
buffer[i] = (byte) int.Parse(s, NumberStyles.HexNumber);
}
return buffer;
}
public static string BytesToHex(byte[] bytes)
{
StringBuilder builder = new StringBuilder();
int num2 = bytes.Length - 1;
for (int i = 0; i <= num2; i++)
{
builder.AppendFormat("{0:X2}", bytes[i]);
}
return builder.ToString();
}