
| Desenvolvimento | | :: :: :: :: :: ::
|
| CERTIFICAÇÃO | |
|
|
| LINKS |
 |
|
| |  | | Home |  |
 | | Gerar Hash Usando MD5 |  | Método prontinho para gerar um hash de uma string usando MD5 /// <summary> /// Metodo que cria um Hash MD5 de uma string /// </summary> /// <param name="input"></param> /// <returns></returns> public string GeraMD5Hash(string input) { if (input == null || input == string.Empty) return null;
System.Security.Cryptography.MD5 md5 = System.Security.Cryptography.MD5.Create(); byte[] inputBytes = System.Text.Encoding.ASCII.GetBytes(input);
byte[] hash = md5.ComputeHash(inputBytes); System.Text.StringBuilder sb = new System.Text.StringBuilder();
for (int i = 0; i < hash.Length; i++) { sb.Append(hash[i].ToString("X2")); }
return sb.ToString(); }
[06/04/2010 09:03 - Fabrizio Gianfratti]
| | 
| WebMail | |
| |
| TRADUTOR ONLINE |
 | |
| Top Páginas | | :: :: :: :: ::
|
|