私は次の機能を持っています:
public string GetRaumImageName()
{
var md5 = System.Security.Cryptography.MD5.Create();
byte[] hash = md5.ComputeHash(Encoding.ASCII.GetBytes("Michael"));
StringBuilder sb = new StringBuilder();
for (int i = 0; i < hash.Length; i++)
{
sb.Append(hash[i].ToString("X2"));
}
return sb.ToString();
}
これは、1つの値で正常に機能します。
ここで、複数の値を暗号化したい。私は何かを試しました:
public string GetRaumImageName()
{
var md5 = System.Security.Cryptography.MD5.Create();
StringBuilder sb = new StringBuilder();
byte[] hash = new byte[0];
foreach (PanelView panelView in pv)
{
hash = md5.ComputeHash(Encoding.ASCII.GetBytes(panelView.Title));
}
for (int i = 0; i < hash.Length; i++)
{
sb.Append(hash[i].ToString("X2"));
}
return sb.ToString();
}
ただし、暗号化を取得する際のリストの最後の値のみ。リストにある複数の値を暗号化して返すにはどうすればよいですか?