/ Published in: C#
(example to be enhanced)
Expand |
Embed | Plain Text
public static byte[] GetHash(string inputString) { HashAlgorithm algorithm = SHA1.Create(); // SHA1.Create() return algorithm.ComputeHash(Encoding.UTF8.GetBytes(inputString)); } public static string GetHashString(string inputString) { foreach (byte b in GetHash(inputString)) sb.Append(b.ToString("X2")); return sb.ToString(); }
You need to login to post a comment.
