title: If .net sha1 hash expects a byte array, and php sha1() wants a string, can I match the results?
body: <p>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.</p>
  
  <p>In .net, you can create a byte array and use sha.ComputeHash().</p>
  
  <pre><code>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);
  </code></pre>
  
  <p>In PHP, you call sha1($string). </p>
  
  <p>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?  </p>
  
  <p>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!</p>