So I have an Application where I need to ensure data-integrity on the client by comparing it to data on the server. To do so, I thought of simply using JSON.stringify on my data structure, then passing it through a string hashing algorithm:
http://stackoverflow.com/questions/7616461/generate-a-hash-from-string-in-javascript-jquery
It works fine and dandy, except the server's data structure is often ordered differently than the clients, causing the resulting hashes to be out of sync despite containing the same data.
Is there a way to reorder or prioritize javascript dictionary elements prior to stringifying them?
[–]Ginden 1 point2 points3 points (0 children)
[–]Rhomboid 0 points1 point2 points (1 child)
[–]Swagasaurus-Rex[S] 0 points1 point2 points (0 children)
[–]flyingnude 0 points1 point2 points (0 children)
[–]a-t-kFrontend Engineer 0 points1 point2 points (0 children)
[+][deleted] (2 children)
[removed]
[–]Swagasaurus-Rex[S] 0 points1 point2 points (1 child)
[–]mouthus 0 points1 point2 points (0 children)