Answer the question
In order to leave comments, you need to log in
How to get the hash sum of an array?
Good afternoon, please tell me if it is possible to get the hash sum of an array in jquery, is it necessary to check if something has changed or not
Answer the question
In order to leave comments, you need to log in
https://github.com/blueimp/JavaScript-MD5
https://github.com/emn178/js-md5
here is another solution https://habrahabr.ru/post/174091/
or you can just serialize to json
1. Compare 2 variables containing old and new array value.
To do this, you do not need to serialize and hash anything - you will only make an extra load.
2. You can make a binary mask: the sum of bits is 1+2+4+8+16+32, etc. to get an identifier for several changed array variables at once.
Do you want to know if something has changed? Then you are here: Object.observe()
No one will forbid you to create Frankensteins, with saving hashes and their further verification. But why, if you can use the built-in functionality and not fool yourself?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question