MD5 Base 64 String - CSharp System.Security.Cryptography

CSharp examples for System.Security.Cryptography:MD5

Description

MD5 Base 64 String

Demo Code


using System.Text;
using System.Security.Cryptography;
using System.IO;//from w w  w  . ja  va2 s.  c om
using System;
using System.Threading.Tasks;
using System.Text;
using System.Linq;
using System.Collections.Generic;
using System;

public class Main{
        public static string MD5Base64(string sourceStr)
        {
            byte[] bytes = new UnicodeEncoding().GetBytes(sourceStr);
            MD5CryptoServiceProvider provider = new MD5CryptoServiceProvider();
            return Convert.ToBase64String(provider.ComputeHash(bytes));
        }
}

Related Tutorials