Load a file and check its integrity...
Hi everybody,
I would like to check the integrity of a distant file that I include in my webpage. To do so, I had write this script using SHA1 function:
-
log.find('div.content').load(path, function() {
var data = log.find('div.content').text();
alert(hex_sha1(data));
});
But the .text() method don't contain the HTML tags of the distant file. So I had tried .html() method like this:
-
log.find('div.content').load(path, function() {
var data = log.find('div.content').html();
alert(hex_sha1(data));
});
And here again, I see that the hash isn't the same because of this method don't includes exactly some char ("\n" or spacing for instance) before and after some tags...
If you see a way to consider directly the loaded file in order to take its hash, that would be very helpful for me.
Thanks a lot,
Dendicus