using System.Security.Cryptography;
using System.Text.RegularExpressions;
public string CreatePasswordSHA1(string password)
{
SHA1CryptoServiceProvider sha1 = new SHA1CryptoServiceProvider();
byte[] bs = System.Text.Encoding.UTF8.GetBytes(password);
bs = sha1.ComputeHash(bs);
System.Text.StringBuilder s = new System.Text.StringBuilder();
foreach (byte b in bs){
s.Append(b.ToString("x2").ToLower());
}
return s.ToString();
}
No hay comentarios:
Publicar un comentario