Hi All,
I've been having some trouble with computeHash. I'm using both computeHash(Stream) and computeHash(byte[]). For some reason, they are giving back different result. I've tried writing the byte[] into a MemStream but result was the same when using Byte[]
FileStream zz = new FileStream(t.Filename, FileMode.Open, FileAccess.Read);
StreamReader sr = new StreamReader(zz, Encoding.ASCII);
byte[] data = Encoding.ASCII.GetBytes(sr.ReadToEnd());
MemoryStream memStream = new MemoryStream(data);
byte[] test = md5hash.ComputeHash(memStream);
I've closed the file to make sure that the seek position is at the starting point.
zz = new FileStream(t.Filename, FileMode.Open, FileAccess.Read);
zz.Position = 0;
byte[] test1 = md5hash.ComputeHash(zz);
Any suggestions? My only guess is that it's an either an Encoding problem or the Stream has a different size.
Any help would be really appreciated.
Best Regards,
SunSatION