accept and return vector<uint8_t> from encode and decode respectively