Click here to Skip to main content
15,905,967 members
Home / Discussions / C#
   

C#

 
GeneralRe: Struct Question Pin
J. Dunlap3-Oct-03 21:24
J. Dunlap3-Oct-03 21:24 
GeneralDirect3D Fullscreen problem Pin
Mikkel Skovby3-Oct-03 10:41
Mikkel Skovby3-Oct-03 10:41 
GeneralCan't delete a registry value! Pin
Alvaro Mendez3-Oct-03 10:26
Alvaro Mendez3-Oct-03 10:26 
GeneralRe: Can't delete a registry value! Pin
Daniel Turini3-Oct-03 10:29
Daniel Turini3-Oct-03 10:29 
GeneralRe: Can't delete a registry value! Pin
Alvaro Mendez3-Oct-03 10:40
Alvaro Mendez3-Oct-03 10:40 
GeneralNow I can. Pin
Alvaro Mendez3-Oct-03 11:08
Alvaro Mendez3-Oct-03 11:08 
GeneralRe: Can't delete a registry value! Pin
Alex Korchemniy4-Oct-03 11:03
Alex Korchemniy4-Oct-03 11:03 
GeneralMD5 HashCode Pin
pahluwalia3-Oct-03 8:07
pahluwalia3-Oct-03 8:07 
Hi,

I am trying to get the Hash Code for a string through MD5 classes in C# but the value that it is printing is not the same as being given by another developer who has used md5 algorithm written in javascript.

Here's the code:
string str = val[1];
// First we need to convert the string into bytes, which means using a text encoder.
System.Text.Encoder enc = System.Text.Encoding.UTF8.GetEncoder();

// Create a buffer large enough to hold the string
byte[] unicodeText = new byte[str.Length * 2];
enc.GetBytes(str.ToCharArray(), 0, str.Length, unicodeText, 0, true);

//Now that we have a byte array we can ask the CSP to hash it
MD5 md5 = new MD5CryptoServiceProvider();
byte[] result = md5.ComputeHash(unicodeText);

//Build the final string by converting each byte into hex and appending it to a StringBuilder
System.Text.StringBuilder sb = new System.Text.StringBuilder();
for (int i=0;i
GeneralRe: MD5 HashCode Pin
Daniel M. Edwards3-Oct-03 9:50
Daniel M. Edwards3-Oct-03 9:50 
QuestionEvents not firing from collections? Pin
FruitBatInShades3-Oct-03 4:26
FruitBatInShades3-Oct-03 4:26 
GeneralByte Arrays Pin
MrEyes3-Oct-03 0:49
MrEyes3-Oct-03 0:49 
GeneralRe: Byte Arrays Pin
Mattias Olgerfelt3-Oct-03 1:04
Mattias Olgerfelt3-Oct-03 1:04 
GeneralRe: Byte Arrays Pin
MrEyes3-Oct-03 2:24
MrEyes3-Oct-03 2:24 
GeneralRe: Byte Arrays Pin
Daniel Turini3-Oct-03 5:45
Daniel Turini3-Oct-03 5:45 
GeneralAxBrowser/mshtml annoyances Pin
mephist2-Oct-03 16:07
mephist2-Oct-03 16:07 
GeneralCreating a virtual drive Pin
jij@esenet.dk2-Oct-03 10:32
jij@esenet.dk2-Oct-03 10:32 
GeneralRe: Creating a virtual drive Pin
Blake Coverett2-Oct-03 20:18
Blake Coverett2-Oct-03 20:18 
GeneralRe: Creating a virtual drive Pin
James Simpson6-Oct-03 1:01
James Simpson6-Oct-03 1:01 
GeneralRe: Creating a virtual drive Pin
jij@esenet.dk7-Oct-03 7:04
jij@esenet.dk7-Oct-03 7:04 
GeneralRe: Creating a virtual drive Pin
jij@esenet.dk7-Oct-03 7:05
jij@esenet.dk7-Oct-03 7:05 
GeneralString question Pin
Mike Ellison2-Oct-03 10:24
Mike Ellison2-Oct-03 10:24 
GeneralRe: String question Pin
Loki2-Oct-03 10:38
Loki2-Oct-03 10:38 
GeneralRe: String question Pin
Nathan Blomquist2-Oct-03 10:41
Nathan Blomquist2-Oct-03 10:41 
GeneralRe: String question Pin
Nathan Blomquist2-Oct-03 10:40
Nathan Blomquist2-Oct-03 10:40 
GeneralRe: String question Pin
Daniel Turini2-Oct-03 11:08
Daniel Turini2-Oct-03 11:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.