MD5 hash is a method to obtain a unique "signature" from a string. It is very usefull in order to store password, but be aware that there is no way to get back to the original string, starting from the hash.
I use it for creating unique filename for caching url crawling.
Here is a snipped of a method that give the MD5 hash from a string:
private string HashString(string Value)
{
System.Security.Cryptography.MD5CryptoServiceProvider x = new System.Security.Cryptography.MD5CryptoServiceProvider();
byte[] data = System.Text.Encoding.ASCII.GetBytes(Value);
data = x.ComputeHash(data);
string ret = "";
for (int i=0; i < data.Length; i++)
ret += data[i].ToString("x2").ToLower();
return ret;
}
lundi 12 mai 2008 | Predicate<T>
Cher Entreprenaute, vous pouvez trouver ici votre passeport pour l'economie numerique
Smart Code Generator
Serialcoder participe activement au projet opensource Smart Code Generator
smartcodegenerator