title: Digest::SHA2.hexdigest generates two completely different values from same parameters
body: <p>This is one of the weirdest I've seen. There's some legacy code I'm maintaining that generates a digest:</p>
  
  <pre><code>require 'digest/sha1'
  def encrypt(password, salt)
    Digest::SHA2.hexdigest("--#{salt}--#{password}--")
  end
  </code></pre>
  
  <p>I call that method with "hello" and "world" as the parameters and I get this:</p>
  
  <pre><code>15ea8ac62708f3810b720b25dd6febe9d0ddc1ed
  </code></pre>
  
  <p>But if I do this directly:</p>
  
  <pre><code>Digest::SHA2.hexdigest("--world--hello--")
  </code></pre>
  
  <p>I get:</p>
  
  <pre><code>c95b3d8968d8044c42ff650ade81315ab9adf120e2b62a637e64fa362cb828dd
  </code></pre>
  
  <p>Excuse my french, but WTF?!</p>
  
  <p>Is there some sort of setting for <code>Digest::SHA2</code> that I should be looking for? What could be triggering the disparity?</p>