title: Javascript Hex to Base32-encoding
body: <p>I'm having issues converting something I know works in Ruby to Javascript (node.js in this case, but I'd like a browser supported solution, if possible) </p>
  
  <p>Given a hex formatted sha256 digest of:</p>
  
  <pre><code>"0b08dfe80a49490ae0722b9306ff53c5ab3552d17905814e6688ee62c373"
  </code></pre>
  
  <p>Convert it to a base32 representation that looks like this:</p>
  
  <pre><code>"BMEN72AKJFEQVYDSFOJQN72TYWVTKUWRPECYCTTGRDXGFQ3T"
  </code></pre>
  
  <p>I can do this in ruby by running a quick routine that converts the hex to a character code string, then base32 encoding that. I can't seem to find a similar approach in JavaScript. There don't seem to be solid approaches for getting the character codes or Base32 encoding. </p>
  
  <p>Ruby code as an example, I'm just chunking the hex out 1 character at a time, and doing a quick hex-> decimal -> character conversion:</p>
  
  <pre><code>s = "0b08dfe80a49490ae0722b9306ff53c5ab3552d17905814e6688ee62c373"
  s2 = s.scan(/../).map { |x| x.hex.chr }.join
  s3 = Base32.encode(s2)
  </code></pre>
  
  <p>The intermediary string looks like this:</p>
  
  <pre><code>"\v\b\xDF\xE8\nII\n\xE0r+\x93\x06\xFFS\xC5\xAB5R\xD1y\x05\x81Nf\x88\xEEb\xC3s\x8AM"
  </code></pre>