SHA1 C# equivalent of this Java
问题 Looking for the same equivalent to this method in C# try { MessageDigest md = MessageDigest.getInstance("SHA-1"); md.update(password.getBytes()); BigInteger hash = new BigInteger(1, md.digest()); hashword = hash.toString(16); } catch (NoSuchAlgorithmException ex) { } } return hashword; 回答1: Super easy in C#: using System; using System.Text; using System.Security.Cryptography; namespace CSharpSandbox { class Program { public static string HashPassword(string input) { var sha1 = SHA1Managed