#
-# Copyright 2005 Free Software Foundation, Inc.
+# Copyright 2005,2007 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
def gen_and_append_crc32(s):
crc = gr.crc32(s)
- return s + struct.pack(">I", hexint(crc))
+ return s + struct.pack(">I", hexint(crc) & 0xFFFFFFFF)
def check_crc32(s):
+ if len(s) < 4:
+ return (False, '')
msg = s[:-4]
#print "msg = '%s'" % (msg,)
actual = gr.crc32(msg)