[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Detecting any changes in a set of Lua objects from C
- From: Marc Balmer <marc@...>
- Date: Fri, 4 Jan 2013 21:57:53 +0100
> I was thinking about checksums earlier for another reason (to hash a lot of table values into one key value). You're right that could occur here.
> Are there any examples of this being done that I could look at?
probably the easiest way is to use openssl for that.
digest = malloc(EVP_MAX_MD_SIZE);
if (digest == NULL)
/* For each data element */
EVP_DigestUpdate(&ctx, element, strlen(element));
EVP_DigestFinal(&ctx, digest, &len);
/* digest now contains the SHA256 hash */
Check the docs.