Reputation: 383
I have a scenario in which my server side code runs in x86 environment where as the client side runs in x64. The issue is happening that we are using String.GetHashCode() to identify the objects within the HashTable since "The behavior of GetHashCode is dependent on its implementation, which might change from one version of the common language runtime to another. " -MSDN. I used the unsafe code to create x86 equivalent GetHashCode() from the following stack overflow question: Can I depend on the values of GetHashCode() to be consistent?.
I had a few questions:
Upvotes: 3
Views: 542
Reputation: 383
Created and extension method that generates a HashCode for the provided string so that it is same even if the client and server are being executed in different environments (x86 or x64).
Upvotes: 1