title: Sha256 is not providing 16 byte array
body: <p>Im using the following method to generate pass phrases for aes encryption.</p>
  
  <p>MY aes needs 16 bytes for a key.</p>
  
  <p>Here is how I am getting my key</p>
  
  <pre><code>    public  byte[] sha256digest16(String[] list) throws NoSuchAlgorithmException, UnsupportedEncodingException {
          MessageDigest digest = MessageDigest.getInstance("SHA-256");
          digest.reset();
          for(String s: list){
              digest.update(s.getBytes("UTF-8"));
          }
          byte[]  b = digest.digest();
  
          return String.format("%0" + (b.length) + 'x', new BigInteger(1, b)).getBytes("UTF-8");
  
      }
  </code></pre>
  
  <p>However, it is 64 bytes. How I can I get this method to return a 16 byte string</p>
  
  <p><strong>EDIT</strong>
  The main reason Im doing this is because my python code is</p>
  
  <pre><code>from Crypto.Hash import SHA256
  
  
  myHash = SHA256.new()
  myHash.update("265jMeges")
  print myHash.hexdigest()
  </code></pre>
  
  <p>which outputs </p>
  
  <pre><code>917ef7e7be4a84e279b74a257953307f1cff4a2e3d221e363ead528c6b556edb
  </code></pre>
  
  <p>where is the java output of is </p>
  
  <pre><code>efbfbd7eefbfbdefbfbd4aefbfbdefbfbd79efbfbd4a257953307f1cefbfbd4a2e3d221e363eefbfbd52efbfbd6b556eefbfbd
  </code></pre>
  
  <p>for the same string. Why are they different?</p>