private static String getFileDigest(@NotNull MessageDigest digest, @NotNull Path file) throws IOException {
    var buf = new byte[65536];
    digest.reset();
    try (var stream = Files.newInputStream(file)) {
      while (true) {
        int count = stream.read(buf);
        if (count <= 0) break;
        digest.update(buf, 0, count);
      }
    }
    return byteArrayToHexString(digest.digest());
  }
private static String getFileDigest(@NotNull MessageDigest digest, @NotNull Path file)