summaryrefslogtreecommitdiffhomepage
path: root/digital/ucoolib/build/tools/crc
blob: cb85a7ff7369eddbb8a5197d009c25175b6fed02 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/usr/bin/python
"""Output CRC32 of files."""
import optparse
import zlib

parser = optparse.OptionParser(usage='%prog [options] files...')
options, args = parser.parse_args()

for f in args:
    with open(f) as fd:
        content = fd.read()
        crc = zlib.crc32(content) & 0xffffffff
        print '%08x  %s' % (crc, f)