public static string PasswordEncryption(this string pass) { string newPass = ""; byte[] arrByte1 = ASCIIEncoding.ASCII.GetBytes(pass); byte[] arrByte2 = new MD5CryptoServiceProvider().ComputeHash(arrByte1); arrByte2.ToList().ForEach(x => newPass += x); return(newPass); }
private static string md5(string solutionDir) { var hash = new MD5CryptoServiceProvider().ComputeHash(Encoding.UTF8.GetBytes(solutionDir)); var builder = new StringBuilder(); hash.ToList().ForEach(x => builder.Append(x.ToString("x2").ToLower())); var encoded = builder.ToString(); return(encoded); }