I want to generate a hash code for a file. Using C# I would do something like this then store the value in a database.
byte[] b = File.ReadAllBytes(@"C:\image.jpg");
string hash = ComputeHash(b);
Now, if i use say a Java program that implements the same hashing alogorithm (Md5), can i expect the hash values to be the equal to the value generated in C#? What if i execute the java program from different environments, Windows, Linux or Mac?