Mercurial > hg > ishara
annotate general/fileutils/md5file.m @ 61:eff6bddf82e3 tip
Finally implemented perceptual brightness thing.
author | samer |
---|---|
date | Sun, 11 Oct 2015 10:20:42 +0100 |
parents | 47cb292350f3 |
children |
rev | line source |
---|---|
samer@7 | 1 % md5file - Use md5sum to compute md5 hash |
samer@7 | 2 % md5file :: string ~'filename' -> string ~'hash'. |
samer@4 | 3 function hash=md5file(fn) |
samer@4 | 4 [rc,result]=system(sprintf('md5sum -b "%s"',fn)); |
samer@4 | 5 if rc==0 |
samer@4 | 6 sp=find(result==' '); |
samer@4 | 7 hash=result(1:sp); |
samer@4 | 8 else |
samer@4 | 9 error('Error running md5sum'); |
samer@4 | 10 end |
samer@4 | 11 end |