I have a set of bytes I want to apply an sha1 hash to. One hash will be in .net, the other in PHP. Then I'll test to see if they match.
In .net, you can create a byte array and use sha.ComputeHash().
byte[] data = new byte[DATA_SIZE];
byte[] result;
SHA1 sha = new SHA1CryptoServiceProvider();
// This is one implementation of the abstract class SHA1.
result = sha.ComputeHash(data);
In PHP, you call sha1($string).
I can't do anything about the .net side of the code, but how can I get the same hash out of PHP that .net will generate?
Please note: I am ONLY able to work on the PHP side of this. The .net stuff is fixed and can't be modified. Thanks!