summaryrefslogtreecommitdiffhomepage
path: root/digital/ucoolib/build/tools/crc
diff options
context:
space:
mode:
Diffstat (limited to 'digital/ucoolib/build/tools/crc')
-rwxr-xr-xdigital/ucoolib/build/tools/crc13
1 files changed, 13 insertions, 0 deletions
diff --git a/digital/ucoolib/build/tools/crc b/digital/ucoolib/build/tools/crc
new file mode 100755
index 00000000..cb85a7ff
--- /dev/null
+++ b/digital/ucoolib/build/tools/crc
@@ -0,0 +1,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)