I have the following function:
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();
}
This works fine with just one value.
Now i want to encrypt multiple values. I tried something:
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();
}
But only the last Value in the list in getting encrypt. How can i encrypt multiples values which are in a list and return them?
This will return all the
Valuesu need asIEnumerable<String>Typical usage