Mercurial > ec-dotfiles
view bin/cek.rb @ 511:ce21ebae61b4
Add /opt/local beforehand in sunos.
author | edogawaconan <me@myconan.net> |
---|---|
date | Sun, 16 Mar 2014 07:50:57 +0000 |
parents | 324c5842af87 |
children | a0f4a3e15322 |
line wrap: on
line source
#!/usr/bin/env ruby require 'zlib' block = 1048576 ARGV.each do |filename| crc = 0 file = File.open(filename, 'rb') currentbyte = 0 while (line = file.read(block)) do crc = Zlib.crc32(line,crc) end file.close printf("%s %08X\n", filename, crc.to_i) end