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

Popular posts from this blog

sql server - python to mssql encoding problem -

java - SNMP4J General Variable Binding Error -

c# - BasicHttpBinding equivalent CustomBinding using WCF Client and PHP WebService -