title: Convert charArray to byteArray
body: <p>I have a string which under all circumstances satisfies <code>([a-zA-Z0-9])*</code>, and I want to let it run through sha1.</p>
  
  <p>So how do I convert the string (or the char array obtained using ToCharArray()) to a byte array?</p>
  
  <p>All answers I found so far have a big bunch of comments why the conversion from string to byte array is evil, they provide links to  character encoding tutorials, and include a bunch of character encodings bloating the code.</p>
  
  <p>Under my circumstances, conversion <em>should</em> be a LINQ oneliner, safe and neat.</p>
  
  <p>I tried:</p>
  
  <pre><code>sha.ComputeHash(validator.ToCharArray().ToArray&lt;byte&gt;())
  </code></pre>
  
  <p>and I played around as far as my LINQ knowledge goes:</p>
  
  <pre><code>sha.ComputeHash(validator.ToCharArray().ToArray&lt;byte&gt;(c =&gt; (byte)c))
  </code></pre>