From C# to VC.net

  • Thread starter Thread starter PawelR
  • Start date Start date
P

PawelR

Hello Group

I've problem with convert this function

private string getMD5(string s1)
{
string s1 = "UserName"
byte[] data1ToHash = (new UnicodeEncoding()).GetBytes(s1);
byte[] hashvalue1 = ((HashAlgorithm) CryptoConfig.CreateFromName
("MD5")).ComputeHash(data1ToHash);
string s2=BitConverter.ToString(hashvalue1);
for (int i=s2.Length;i>3;i-=3) s2=s2.Remove(i-3,1);
s2=s2.Replace("A","1");
s2=s2.Replace("0","A");
s2=s2.Replace("1","0");
return s2;
}

This generate hash string - code to application.
My question: How write this function in C++.Net (mfc)?

Thx
PawelR
 
What problem are you facing? Show the MC++ version you created and also
state what errors you got when you tried to compile that.
 
What problem are you facing? Show the MC++ version you created and also
state what errors you got when you tried to compile that.
 
Back
Top