module NSCA class <>1) ^ (0xEDB88320 * (r&1)) } end) ^ 0xFFFFFFFF end # Builds a null terminated, null padded string of length maxlen def str2cstr( str, maxlen = nil) str = str.to_s str = str.to_s[0..(maxlen-2)] if maxlen "#{str}\x00" end def cstr2str( str, maxlen = nil) str[ 0, x.index( ?\0) || ((maxlen||0)-1)] end end class Packet class CSC32CheckFailed