2
votes

I am trying to get a CRC or md5 of the bytes from a resource or node with properties within cq5 within a resource or a node.

For example, say I have a DAM asset, I would like to get an MD5 fingerprint of the byte blob containing the image data, so that I know when the data inside has changed.

The same would be handy for a node. Is there any inbuilt way in CQ5 to get this?

1

1 Answers

2
votes

Have you tried adding the 'etag' mixin to the nodes you want checksummed? To quote the spec on the etag mixin:

A jcr:etag property is an opaque string whose syntax is identical to that defined for entity tags in HTTP/1.1. Semantically, the jcr:etag is comparable to the HTTP/1.1 strong entity tag.

On creation of a mix:etag node N, or assignment of mix:etag to N, the repository must create a jcr:etag property with an implementation determined value.

The value of the jcr:etag property must change immediately on persist of any of the following changes to N:

  • A BINARY property is added to N.
  • A BINARY property is removed from N.
  • The value of an existing BINARY property of N changes.