title: C# use SHA1 to hash string into byte array
body: <p>I'm using SHA1 to encrypt some values like password.
  This is my code:</p>
  
  <pre><code>String passwd = Membership.GeneratePassword(10, 2);
  SHA1 sha = new SHA1CryptoServiceProvider();
  byte [] password = sha.ComputeHash(passwd);
  </code></pre>
  
  <p>But VS returns error, because passwd is a string.
  I have to store the password in a byte array, so is there a way to solve this?</p>