Generate Hash : Hash « Security « C# / C Sharp






Generate Hash

 

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;

public class Security
{
    public static string GenerateHash(string texto)
    {
        UnicodeEncoding Ue = new UnicodeEncoding();
        byte[] ByteSourceText = Ue.GetBytes(texto);
        MD5CryptoServiceProvider Md5 = new MD5CryptoServiceProvider();
        byte[] ByteHash = Md5.ComputeHash(ByteSourceText);
        return Convert.ToBase64String(ByteHash);
    }
}

   
  








Related examples in the same category

1.Verify Hex Hash, Base64 Hash, Byte Hash
2.Generic Hash
3.Get Public Key Hash with HttpClientCertificate
4.Get Public Key Hash with SHA256
5.Get Public Key Hash for a string
6.Hash As Password
7.Get Hash for password
8.Generates a hash code of the input string
9.Hash Data
10.Hash Password
11.Get SHA256 Hash
12.Create Password Hash