public static byte[] hash(byte[] input){
  if (input != null) {
    final MessageDigest digest;
    try {
      digest=MessageDigest.getInstance("SHA-256");
      byte[] hashedBytes=input;
      digest.update(hashedBytes,0,hashedBytes.length);
      return hashedBytes;
    }
 catch (    NoSuchAlgorithmException e) {
      Log.e(TAG,"problem hashing \"" + input + "\" "+ e.getMessage(),e);
    }
  }
 else {
    Log.w(TAG,"hash called with null input byte[]");
  }
  return null;
}

public static byte [ ] hash ( byte [ ] input ) { if ( input != null ) { final MessageDigest digest ; try { digest = MessageDigest . getInstance ( "SHA-256" ) ; byte [ ] hashedBytes = input ; digest . update ( hashedBytes , 0 , hashedBytes . length ) ; return hashedBytes ; } catch ( NoSuchAlgorithmException e ) { Log . e ( TAG , "problem hashing \"" + input + "\" " + e . getMessage ( ) , e ) ; } } else { Log . w ( TAG , "hash called with null input byte[]" ) ; } return null ; }
created sha256 of input
