c# - Is there a way to generate a Guid from a list of Guids? -


i have list of objects have guids ids. want use ids in list of objects create guid can use ensure list has not changed. if object removed/added guid different. thing comes mind using hash. maybe should use hash, wondering if possible faster generating hash?

edit: getting list stored procedure. storing list of objects memory cache. each user going validate local value in cookie against generated value ensure list still same.

when need know if object same before can't rely on hashing alone - hash of object allows tell objects different, not guarantee objects same.

generally there several approaches solve that:

  • frequently small rate of potential collisions on hash values acceptable , can use hash long enough satisfy requirement. crypto-hash functions sha256 provide low enough collision rate live it. such value fit in http cookie if needed.
  • if objects small enough (i.e. several k) sending whole object client may option (will give chance perform exact comparison on postbacks).
  • if can version objects in way guaranteed unique (modified date, current sequential update auto-increment) particular object can keep piece of information. such versioning information small , easy send in cookie.

note: depending on requirement may need encrypt/sign cookie values (possibly salt) prevent client code tampering cookie values.


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -