bejancsaba commented on code in PR #6375:
URL: https://github.com/apache/nifi/pull/6375#discussion_r966036354


##########
c2/c2-client-bundle/c2-client-service/src/main/java/org/apache/nifi/c2/client/service/C2HeartbeatFactory.java:
##########
@@ -225,4 +242,14 @@ private File getConfDirectory() {
 
         return confDirectory;
     }
+
+    public String calculateManifestHash(List<Bundle> loadedBundles) {
+        byte[] bytes = messageDigest.digest(loadedBundles.stream()

Review Comment:
   Thanks, updated



##########
c2/c2-client-bundle/c2-client-service/src/main/java/org/apache/nifi/c2/client/service/C2HeartbeatFactory.java:
##########
@@ -225,4 +242,14 @@ private File getConfDirectory() {
 
         return confDirectory;
     }
+
+    public String calculateManifestHash(List<Bundle> loadedBundles) {
+        byte[] bytes = messageDigest.digest(loadedBundles.stream()
+            .map(bundle -> bundle.getGroup() + bundle.getArtifact() + 
bundle.getVersion())
+            .sorted()
+            .collect(Collectors.joining(","))
+            .getBytes(StandardCharsets.UTF_8));
+
+        return UUID.nameUUIDFromBytes(bytes).toString();

Review Comment:
   Updated as requested



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to