comparison bin/cek.rb @ 4:94ee419ad047

Added bin-ec - a collection of scripts.
author Edho Prima Arief <me@myconan.net>
date Sat, 10 Jul 2010 12:38:52 +0000
parents
children 72c299437fde
comparison
equal deleted inserted replaced
3:39ef7f7236fc 4:94ee419ad047
1 #!/usr/bin/env ruby
2 require 'zlib'
3
4 block = 1048576
5 ARGV.each do |filename|
6 crc = 0
7 file = File.open(filename, 'rb')
8 currentbyte = 0
9 while (line = file.read(block)) do
10 crc = Zlib.crc32(line,crc)
11 end
12 file.close
13 printf("%s %08X\n", filename, crc.to_s)
14 end