title: How to Hash String using SHA-1 with key?
body: <p>The time I used to develop applications on iPhone I was converting String to SHA1 with two combination:</p>
  
  <ul>
  <li>Data</li>
  <li>Key</li>
  </ul>
  
  <p>Now I am developing an Android application and I did not any example for how to calculate SHA1 With key.</p>
  
  <p>I am greatly appreciative of any guidance or help.</p>
  
  <p><hr><em>[The code that I currently  use]</em></p>
  
  <pre><code>private void convertStringToSHA1()
  {
          String sTimeStamp  = new SimpleDateFormat("MM/dd/yyyy HH:MM:SS").format(new java.util.Date());
          String sStringToHash = String.format("%1$s\n%2$s", "Username",sTimeStamp);
  
          MessageDigest cript = MessageDigest.getInstance("SHA-1");
          cript.reset();
  
          cript.update(sStringToHash.getBytes("utf-8"));
          sStringToHash = new BigInteger(1, cript.digest()).toString(16);
  }
  </code></pre>