MD5生成

    public static string CreateMd5(string text)
    {
        MD5 md5 = MD5.Create();
        byte[] md5Byte= md5.ComputeHash(Encoding.ASCII.GetBytes(text));
        StringBuilder sb = new StringBuilder();
        foreach (byte b in md5Byte)
        {
            sb.Append(b.ToString("x2"));
        }
        return sb.ToString();
    }
posted @ 2023-04-25 16:40  AWT-Stephen  阅读(56)  评论(0编辑  收藏  举报