N
N
nezzard2016-12-02 20:56:29
JavaScript
nezzard, 2016-12-02 20:56:29

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

4 answer(s)
I
iBird Rose, 2016-12-02
@iiiBird

https://github.com/blueimp/JavaScript-MD5
https://github.com/emn178/js-md5

M
Maks Codov, 2016-12-02
@4604590

here is another solution https://habrahabr.ru/post/174091/
or you can just serialize to json

X
xmoonlight, 2016-12-02
@xmoonlight

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.

P
profesor08, 2016-12-03
@profesor08

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 question

Ask a Question

731 491 924 answers to any question