using System; using System.Collections.Generic; using System.Linq; using System.Security.Cryptography; using System.Text; using System.Threading.Tasks; using System.Web.Security;
namespace ConsoleApplication1 { public static class Clas { public static string MD5 (this string text) { return FormsAuthentication.HashPasswordForStoringInConfigFile (text “md5“); }
[System.Diagnostics.CodeAnalysis.SuppressMessage(“Microsoft.Naming“ “CA1709:IdentifiersShouldBeCasedCorrectly“ MessageId = “SHA“)] public static string SHA1 (this string text) { return FormsAuthentication.HashPasswordForStoringInConfigFile (text “sha1“); } public static string GetMD5_32(string s string _input_charset) { MD5 md5 = new MD5CryptoServiceProvider(); byte[] t = md5.ComputeHash(Encoding.GetEncoding(_input_charset).GetBytes(s)); StringBuilder sb = new StringBuilder(32); for (int i = 0; i < t.Length; i++) { sb.App
评论
共有 条评论