Mercurial > ec-dotfiles
comparison bin/cek.rb @ 129:f18a27a0e8fc
Merge branch.
| author | Edho Arief <edho@myconan.net> |
|---|---|
| date | Sat, 29 Oct 2011 11:40:35 +0700 |
| parents | 94ee419ad047 |
| children | 72c299437fde |
comparison
equal
deleted
inserted
replaced
| 121:0c3b473b9af7 | 129:f18a27a0e8fc |
|---|---|
| 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 |
