2020. 8. 25. 17:17
Unity/C#
v1
public string GetMD5(byte[] data)
{
System.Text.StringBuilder sb = new System.Text.StringBuilder();
byte[] hash = System.Security.Cryptography.MD5.Create().ComputeHash(data);
foreach (byte b in hash)
{
sb.Append(b.ToString("X2"));
}
return sb.ToString();
}
v2
public string GetMD5(byte[] data)
{
byte[] bytes = System.Security.Cryptography.MD5.Create().ComputeHash(data);
return System.BitConverter.ToString(bytes).Replace("-", "");
}
'Unity > C#' 카테고리의 다른 글
failed to connect to localhost port 80: Connection (0) | 2020.09.01 |
---|---|
UnityWebRequest (0) | 2020.08.20 |
형변환 모음 (0) | 2020.08.11 |