> > The string I'm sending looks like this:
> > "root" "#6E6BC4E49DD477EBC98EF4046C067B5F"
>
> How do you build the source string that produces :
>
> #6E6BC4E49DD477EBC98EF4046C067B5
>
private string GetMD5Digest() {
HashAlgorithm md5 = new MD5CryptoServiceProvider();
byte[] bytes = Encoding.ASCII.GetBytes(login.Password);
byte[] hash = md5.ComputeHash(bytes);
char[] delimiter = { '-' };
string[] hexes = BitConverter.ToString(hash).Split(delimiter);
return String.Join("", hexes);
}
In case you're wondering why I use the Split, Join methods, C#'s
BitConverter class method ToString takes a byte array and displays it as a
Unicode string with the hex values separated by dashes. I am simply
removing the dashes from the string and concatenating the resulting string
array into a string.
Rob
-
To unsubscribe from this list: send the line "unsubscribe xmail" in
the body of a message to [EMAIL PROTECTED]
For general help: send the line "help" in the body of a message to
[EMAIL PROTECTED]