code: def encode_value(value, flags=None, base64=False):
      
      if flags:
          # still a no-operation
          logger.debug("Flag %s encoding not implemented yet" % flags)
      if not isinstance(value, bytes):
          raise ValueError("value must be bytes")
      return b64encode(value) if base64 else value
docs: Mostly used by payloads