OmegaPhil / animecheck

Commandline CRC32, MD5 and eD2k-based hashing script also capable of reading and creating SFV and MD5 checksum files and generating eD2k links. This is an initial foray into python and github
GNU General Public License v3.0
46 stars 5 forks source link

Request: Adding individual hash comparison #26

Closed darealshinji closed 11 years ago

darealshinji commented 11 years ago

What I mean is the idea to copy+paste a CRC/MD5 hash and compare it to a single file without the need of creating an .md5 or .sfv file to do that. I'm thinking of something like this: animecheck --checkmd5="d766f8922840576f654839aef4b57c52" "ubuntu-13.10-desktop-amd64+mac.iso" animecheck --checkcrc32="6FBE4124" "Anime_[6FBE4124].mkv"

OmegaPhil commented 11 years ago

Hmm, I'm not sure about this. This is too close to what you can already knock up with a script, or should be doable with a script (I'm supposed to follow the UNIX philosophy of doing one thing and doing it well - already breached with the different hash modes etc, but I've tried to keep things simple).

You know the hash you want, therefore if you run animecheck and get a different hash then its bad. animecheck'll do CRC32 hashes automatically and MD5 hashes with --md5-hash-mode.

Is there something that could be changed to make animecheck more scriptable?

darealshinji commented 11 years ago

Yeah, you're right. I did some Google search and wrote a simple shell script to do that:

!/bin/sh

if [ $# -eq 0 ] ; then echo "Usage: \033[1;37mmd5compare\033[0m [MD5SUM] [FILE]" exit 0 else md5check=${1} md5file=md5sum -b "${2}" | cut -b-32 [ $md5check = $md5file ] && echo "\033[1;32mEqual\033[0m" || echo "\033[1;31mNot Equal\033[0m" fi

It's very useful to me to compare md5 sums for single ISO files.

OmegaPhil commented 11 years ago

OK, I will close this.