How to efficiently compute checksum on core-data attribute for online verification?

47 Views Asked by At

I need to find a way to verify the contents of core-data entities against the online database from which the data originated.

Essentially I need a fingerprint of a core-data entity or attribute that I can reasonably replicate in other common systems (4d.com database in my case but could be anything).

I'm building a JSON text string of two key attributes and calculating a checksum, in both Swift and the host database:

dStr+="{"+"\"uuid\":\""+jUuid+"\","+"\"modUTC\":\""+jModUtc+"\"}" // uuid and datetime
// ...
checksum = md5(dStr) // this to be compared to checksum of/by online database

works well but is terribly inefficient (and slow on older phones).

Ideas appreciated.

0

There are 0 best solutions below