Page 1 of 1

Quick and Dirty verion calculation

Posted: Fri Apr 20, 2007 1:54 am
by alex.barylski
I need a quick way to determine the exact version of an application (basically to tell whether it's been modified).

What I have done:

1) Recursively glob each file in the app directory
2) Calculate a MD5 hash of each file, storing that in an array
3) Iterate final array of hashes and MD5 those as well

Perhaps CRC would be better?

I'm using md5_file in hopes it's slightly faster as this process can be CPU intensive...

Suggestions?

p.s-basically I take a MD5 snapshot of the application at release date and that offers a lookup table to quickly detemrine the version - unless modified source of course. It lets me know immediately if clients really haven't touched anything and gives me an idea of what files need updating, to avoid uploading the entire source tree each time an update is required.

Cheers :)