Possible Duplicate:
Hash Function .NET
hi,
I should write an app that take string input and compute the hash value for the string (the maximun characters of the input is 16), the output should be in length of 22 characters (or less but not more) on base64 format.
I see that .NET framework suggests several hash functions, and I don’t know what to use,
does anyone have asuggest to me what is the best function to use, and how can I limit the output to 22 characters (on base64)?
thanks
You could use any of the hashing function and simply truncate the hash to the required size, then convert to base-64. In your case, you would need to truncate the hash to 15-bytes, which ends up as 20-bytes of base-64. I’m going to reuse my previous example.