I came across this thread after having the same MD5 issues that initially started the thread. Since I'm working in Windows / C#, I figured I would provide my C# 3.0 Extension Method that *appears* to create a valid MD5 hash (ie, I haven't had any problems with it yet)
public static string CreateMD5Hash(this byte[] contentsToHash)
{
System.Security.Cryptography.MD5 hasher = System.Security.Cryptography.MD5.Create();
byte[] hashBytes = hasher.ComputeHash(contentsToHash);
StringWriter writer = new StringWriter();
foreach (byte b in hashBytes)
{
writer.Write("{0:x2}", b);
}
return writer.ToString();
}
Does this look right to you smugmug experts out there? If so, what about adding a little note in the documentation that clearly shows some examples in C#, Java, PHP, Perl, etc on how to create MD5 hashes that sugmug understands. I don't think that the the user should need to to surf the dgrin forums to figure out how to MD5 hash their image.
Comments
Does this look right to you smugmug experts out there? If so, what about adding a little note in the documentation that clearly shows some examples in C#, Java, PHP, Perl, etc on how to create MD5 hashes that sugmug understands. I don't think that the the user should need to to surf the dgrin forums to figure out how to MD5 hash their image.