public static MessageDigest newDigest(){
  try {
    return MessageDigest.getInstance("SHA-256");
  }
 catch (  NoSuchAlgorithmException e) {
    throw new RuntimeException(e);
  }
}

public static MessageDigest newDigest ( ) { try { return MessageDigest . getInstance ( "SHA-256" ) ; } catch ( NoSuchAlgorithmException e ) { throw new RuntimeException ( e ) ; } }
returns a new sha - 256 messagedigest instance . this is a convenience method which wraps the checked exception that can never occur with a runtimeexception .
