function encode($payload) { $enc = new Encoder($payload, $this->spec); return $enc->writeData()->export(); }