Keep in mind that successfully ftping a file doesn't guarantee that it'll have the same checksum at the source and destination. If you ftp in ASCII mode, ftp will convert line endings for you (which I consider a good feature). This will destroy your scheme.
The only easy day was yesterday
Re: get md5 sum of a remote file via net::ftp / net::sftp