How to calculate MD5 in C#
Not only wget but also MD5SUM, I have been asked how to implement this functionality in C#. Again and again, I wrote below code in Mono on Ubuntu Feisty.
using System;
using System.Text;
using System.Security.Cryptography;
class MD5Sum {
public string GetMd5Sum(string str) {
byte[] input = ASCIIEncoding.ASCII.GetBytes(str);
byte[] output = MD5.Create().ComputeHash(input);
StringBuilder sb = new StringBuilder();
for(int i=0;i
I used very similar Makefile as follows.
TARGET=md5sum.exe
MCS=mcs
all: $(TARGET)
clean:
rm -f $(TARGET)
%.exe: %.cs
$(MCS) $(MCSFLAGS) $(LIBS) -out:$@ $<
- sugree's blog
- 7260 reads


How to calculate MD5 in C#
Post new comment