title: What does ["string"].pack('H*') mean?
body: <p>I need to translate some Ruby code to JavaScript and came across the following function:</p>
  
  <pre><code>def sha1_hex(h)
    Digest::SHA1.hexdigest([h].pack('H*'))
  end
  </code></pre>
  
  <p>What exactly does <code>[h].pack('H*')</code> mean in this context? How would it translate to JavaScript?</p>