src/utils/message.cpp
/**
 * @brief Convert the message to its JSON representation.
 *
 * @return std::string
 **/
@brief Convert the message to its JSON representation.
@return std::string
@brief Convert the message to its JSON representation . @return std :: string
std::string Ark::Crypto::Utils::Message::toJson() {
  std::map<std::string, std::string> messageArray = this->toArray();
  const size_t capacity = JSON_OBJECT_SIZE(3);
  DynamicJsonBuffer jsonBuffer(capacity);
  JsonObject& root = jsonBuffer.createObject();
  root["publickey"] = messageArray["publickey"];
  root["signature"] = messageArray["signature"];
  root["message"] = messageArray["message"];
  char jsonChar[root.measureLength() + 1];
  root.printTo((char*)jsonChar, sizeof(jsonChar));
  return jsonChar;
}
std :: string Ark :: Crypto :: Utils :: Message :: toJson ( ) { std :: map < std :: string , std :: string > messageArray = this -> toArray ( ) ; const size_t capacity = JSON_OBJECT_SIZE ( 3 ) ; DynamicJsonBuffer jsonBuffer ( capacity ) ; JsonObject & root = jsonBuffer . createObject ( ) ; root [ " " ] = messageArray [ " " ] ; root [ " " ] = messageArray [ " " ] ; root [ " " ] = messageArray [ " " ] ; char jsonChar [ root . measureLength ( ) + 1 ] ; root . printTo ( ( char * ) jsonChar , sizeof ( jsonChar ) ) ; return jsonChar ; }
@brief Convert the message to its JSON representation.
@brief Convert the message to its JSON representation .