title: How to generate sha256 hashes of hexadecimal binary data in JavaScript?
body: <p>I need a function in JavaScript that generate similar result what this command generate in linux.</p>
  
  <pre><code>echo -n '28349b1d4bcdc9905e4ef9719019e55743c84efa0c5e9a0b077f0b54fcd84905' | xxd -r -p | sha256sum -b | awk '{print $1}'
  </code></pre>
  
  <p>This command outputs:</p>
  
  <pre><code>d533f24d6f28ddcef3f066474f7b8355383e485681ba8e793e037f5cf36e4883
  </code></pre>
  
  <p>What this command does is: given an hexadecimal string, convert it to binary, and display the sha256 hash of the binary data.</p>
  
  <p>I tried different libraries but they simply out put sha256 string.
  but that doesn't fulfill my requirement i need exact result of the command above.
  Can anyone help me please ?</p>