converting from int to hex

Posted by Catherine on Stack Overflow See other posts from Stack Overflow or by Catherine
Published on 2011-01-02T19:17:07Z Indexed on 2011/01/02 19:53 UTC
Read the original article Hit count: 198

Filed under:
|
|
|

I want to convert some ints to hex,but i'm getting something like this : "?|???plL4?h??N{" from 12345. Why?

int t = 12345;

System.Security.Cryptography.MD5CryptoServiceProvider ano = new
System.Security.Cryptography.MD5CryptoServiceProvider();

byte[] d_ano = System.Text.Encoding.ASCII.GetBytes(t.ToString());
byte[] d_d_ano = ano.ComputeHash(d_ano);

string st_data1 = System.Text.Encoding.ASCII.GetString(d_d_ano);
string st_data = st_data1.ToString();

I'm using it in window form,not in console.

© Stack Overflow or respective owner

Related posts about c#

Related posts about string