def nunpack(s, default=0):
 l = len(s)
 if (not l):
  return default
 elif (l == 1):
  return ord(s)
 elif (l == 2):
  return struct.unpack('>H', s)[0]
 elif (l == 3):
  return struct.unpack('>L', ('\x00' + s))[0]
 elif (l == 4):
  return struct.unpack('>L', s)[0]
 else:
  raise TypeError(('invalid length: %d' % l))

def nunpack ( s , default = 0 ) : l = len ( s ) if ( not l ) : return default elif ( l == 1 ) : return ord ( s ) elif ( l == 2 ) : return struct . unpack ( '>H' , s ) [ 0 ] elif ( l == 3 ) : return struct . unpack ( '>L' , ( '\x00' + s ) ) [ 0 ] elif ( l == 4 ) : return struct . unpack ( '>L' , s ) [ 0 ] else : raise TypeError ( ( 'invalid length: %d' % l ) )
unpacks 1 to 4 byte integers .