26
1
using System;
2
using System.Text;
3
using System.Security.Cryptography;
4
5
public class Program
6
{
7
public static void Main()
8
{
9
StringBuilder hash = new StringBuilder();
10
11
// input string
12
string input = "Technology crowds";
13
14
// defining MD5 object
15
var md5provider = new MD5CryptoServiceProvider();
16
// computing MD5 hash
17
byte[] bytes = md5provider.ComputeHash(new UTF8Encoding().GetBytes(input));
18
for (int i = 0; i < bytes.Length; i++)
19
{
20
hash.Append(bytes[i].ToString("x2"));
21
}
22
23
// final output
24
Console.WriteLine(string.Format("The MD5 hash is: {0}",hash));
25
}
26
}
Cached Result
The MD5 hash is: e6ff808188419ba062acbeb4163e966b