The absolute minimum every software developer …
By rickvdbosch
- 2 minutes read - 227 wordsOne of the posts that is being read quite frequently over here is HOWTO: Encode a password using MD5 in C# (or: howto calculate the MD5 hash for a string). One of the (many) reactions to that post was from one Simucal, stating:
Also, to the original poster, Rick van den Bosch… shame on you for using ASCIIEncoding.Default.GetBytes(). You do realize that would seriously restrict the usefulness of your method to working only in languages that ASCII has the character sets for, right?
I suggest you read this article entitled:
The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets (No Excuses!)
Yes, I do realize that using ASCIIEncoding.Default.GetBytes() would seriously restrict the usefulness of the method to working only in languages that ASCII has the character sets for. The primary reason for the post was to illustrate the way to calculate the hash. Representing it as a string was only there to be complete for a specific scenario. I did not try to write a hashing function for every language 😉
That being said, the post Simucal refers to is a good one, and it truly is the absolute minimum every software developer absolutely, positively must know about unicode and character sets. And I guess there are no excuses ;). So if you haven’t done so already, go and read it.