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

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -