Get MD5 16 byte - CSharp Security

CSharp examples for Security:MD5

Description

Get MD5 16 byte

Demo Code


using System.Runtime.Serialization.Formatters.Binary;
using System.Configuration;
using System.Net;
using System.Net.Mail;
using System.Drawing;
using System.Xml.Xsl;
using System.Xml;
using System.Data;
using System.Data.OleDb;
using System.IO;//from ww w. j  a  v a2  s  .c o m
using System.Web.Security;
using System.Security.Cryptography;
using System.Text.RegularExpressions;
using System.Text;
using System.Collections;
using System.Web;
using System.Linq;
using System.Collections.Generic;
using System;

public class Main{
        public static string GetMd5_16(string ConvertString)
        {
            MD5CryptoServiceProvider md5 = new MD5CryptoServiceProvider();
            string t2 = BitConverter.ToString(md5.ComputeHash(UTF8Encoding.Default.GetBytes(ConvertString)), 4, 8);
            t2 = t2.Replace("-", "");
            return t2;
        }
}

Related Tutorials