javascript - Better way than MD5? -
i'm wondering there quicker, more efficent way of comparing 2 text files check equality comparing md5 of 2 files? i'm using javascript.
if have calculate md5 of files each time this, might check lengths same, compare them byte byte. calculating md5 (or other hash) means running through whole file anyway.
pseudocode:
bool filesaresame(file1, file2) { if (file1.length != file2.length) return false; (int i=0;i<file1.length;i++) { if (file1[i] != file2[i]) return false; } return true; }
Comments
Post a Comment