Add simplistic CRC32 checker executable

This commit is contained in:
2013-01-07 11:53:53 +00:00
parent 4abad78d3f
commit 98d8890323

17
bin/crc32checker Executable file
View File

@@ -0,0 +1,17 @@
#! /usr/bin/env ruby
ARGV.each do |path|
print "Checking \"#{path}\"... "
if !File.exists?(path)
puts "FILE NOT FOUND"
next
end
checksum = `crc32 "#{path}"`.strip.upcase
if File.basename(path).upcase.include?(checksum)
puts "MATCH (#{checksum})"
else
puts "FAIL (#{checksum})"
end
end