public static Sha256Hash create(byte[] contents){
  try {
    MessageDigest digest=MessageDigest.getInstance("SHA-256");
    return new Sha256Hash(digest.digest(contents));
  }
 catch (  NoSuchAlgorithmException e) {
    throw new RuntimeException(e);
  }
}

public static Sha256Hash create ( byte [ ] contents ) { try { MessageDigest digest = MessageDigest . getInstance ( "SHA-256" ) ; return new Sha256Hash ( digest . digest ( contents ) ) ; } catch ( NoSuchAlgorithmException e ) { throw new RuntimeException ( e ) ; } }
calculates the ( one - time ) hash of contents and returns it as a new wrapped hash .
