code: private static byte[] canonicalRequestDigest(URIish uri)
  			throws NoSuchAlgorithmException {
  		StringBuilder canonicalRequest = new StringBuilder();
  		canonicalRequest.append("GIT\n") // codecommit uses GIT as the request method
  				.append(uri.getPath()).append("\n") // URI request path
  				.append("\n") // Query string, always empty for codecommit
  				// Next is canonical headers, codecommit only requires the host header
  				.append("host:").append(uri.getHost()).append("\n").append("\n") // canonical
  																					// headers
  																					// are
  																					// always
  																					// terminated
  																					// by
  																					// newline
  				.append("host\n"); // The list of canonical headers, only one for
  									// codecommit
  
  		MessageDigest digest = MessageDigest.getInstance(SHA_256);
  
  		return digest.digest(canonicalRequest.toString().getBytes());
  	}
docs: Creates a message digest.
  @param uri uri to process
  @return a message digest
  @throws NoSuchAlgorithmException when the SHA 256 algorithm is not found