|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
ASCIIEncoding.GetString returns different valuesI'm converting an asp.net 1.1 app to 2.0 and am having difficulty
determining why ASCIIEncoding.GetString returns a different value in ..NET 2.0 than 1.1. The code is simple but I can't locate the problem. If someone could point out my oversight, I'd greatly appreciate it. Thanks in advance! Dim md5Hasher As New MD5CryptoServiceProvider Dim encoder As New ASCIIEncoding Dim strHashedBytes As Byte() = md5Hasher.ComputeHash(encoder.GetBytes(SOMESTRING)) Return encoder.GetString(strHashedBytes) >I'm converting an asp.net 1.1 app to 2.0 and am having difficulty I think there were some changes in how it handles byte values > 127.>determining why ASCIIEncoding.GetString returns a different value in >.NET 2.0 than 1.1. But those are outside the ASCII range and if you have that in your data (which you most likely will have in a computed hash) you shouldn't be using ASCIIEncoding at all. For random binary data, you should consider using Base64 encoding instead if you need to store a string representation of it. Mattias -- Mattias Sjögren [C# MVP] mattias @ mvps.org http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com Please reply only to the newsgroup.
Writing text to file
try Catch for empty textfield Passing System.Enum as a parameter type... Help! VB Express & Excel automation ? Crystal Reports for .NET 2005 secuity issue with terminal services connection? VB .Net (VisualStudio 2005) and the SQL Server SMO Object question Getting Data out of MS Project string process moving controls with in an image Fade out problem on a form with irregular backgroud image |
|||||||||||||||||||||||