I have a list of objects they have guids for ids. I want to use the ids in this list of objects to create a guid that I can use ensure that the list has not changed. If an object was removed/added the guid would be different. The thing that comes to mind is using a hash. Maybe I should just use a hash, but I am wondering if it is possible that this could be faster than generating a hash?
EDIT: I am getting this list from a stored procedure. Then storing the list of objects into memory cache. Each user is going to validate their local value in a cookie against this generated value to ensure that the list is still the same.
When you need to know if object is exactly the same as before you can't rely on hashing alone - hash of an object allows you to definitely tell that objects are different, but it does not guarantee that objects are the same.
Generally there are several approaches to solve that:
Note: depending on your requirement you may need to encrypt/sign cookie values (possibly with salt) to prevent client code from tampering with your cookie values.