How to correctly generate SHA-256 checksum for a string in scala? : <p>I need to generate an SHA-256 checksum from a string that will be sent as a <em>get</em> param.</p>

<p>If found <a href="https://stackoverflow.com/questions/5531455/how-to-hash-some-string-with-sha256-in-java">this link</a> to generate the checksum.</p>

<p>Genrating the checksum like so:</p>

<pre><code>  val digest = MessageDigest.getInstance("SHA-256");      
  private def getCheckSum() = {
    println(new String(digest.digest(("Some String").getBytes(StandardCharsets.UTF_8))))        
  }
</code></pre>

<p>prints checksum similar to this:</p>

<pre><code>*║┼¼┬]9AòdJb:#↓o6↓T╞B5C♀¼O~╟╙àÿG
</code></pre>

<p>The API that we need to send this to says the checksum should look like this:</p>

<pre><code>45e00158bc8454049b7208e76670466d49a5dfb2db4196
</code></pre>

<p>What am I doing wrong?</p>

<p>Please advise.
Thanks.</p>
