code: def _value_length(self, value, t):
          
  
          if isinstance(value, int):
              fmt = '<%s' % (type_codes[t])
              output = struct.pack(fmt, value)
              return len(output)
          elif isinstance(value, str):
              return len(value) + 1  # Account for final 0
  
          len_accum = 0
          for x in value:
              len_accum += self._value_length(x, t)
  
          return len_accum
docs: Given an integer or list of them, convert it to an array of bytes.