[Mono-list] Issue with SHA256 on Mono

Varun Rai varun.wipro at gmail.com
Tue May 5 07:00:50 EDT 2009


I computed a hash for the file stream in mono. And the same method i used on
windows to compute the hash of the same file. I get two different byte
arrays. I tried to look into the problem but till now no solution. Does any
one know why this happens?

Thanks,
Varun

public static byte[] GetFileHash(string fileName)
        {
            byte[] dataHash = null;

            FileStream fs = new
FileStream(fileName,FileMode.Open,FileAccess.Read,FileShare.Read);
			byte[] data = new byte[fs.Length];
				
			fs.Read(data,0, Convert.ToInt32(fs.Length));
			fs.Close();
				
			SHA256 sha = new SHA256Managed();
			dataHash = sha.ComputeHash(data);
            
            return dataHash;
        }
-- 
View this message in context: http://www.nabble.com/Issue-with-SHA256-on-Mono-tp23385233p23385233.html
Sent from the Mono - General mailing list archive at Nabble.com.



More information about the Mono-list mailing list