title: Javascript Ascii Encoding
body: <p>How to convert a JavaScript string to byte array using ASCII encoding?</p>
  
  <p>In C#, it is done as:</p>
  
  <pre><code> var encoding = new System.Text.ASCIIEncoding();
   byte[] keyByte = encoding.GetBytes(string); 
  </code></pre>
  
  <p>I want to do the same in JavaScript for my nodejs server</p>