Compute checksum internally without calling md5sum

tested on 64-bit linux, may not work on OSX or Windoze.