Add 'hostid' to server_info

* Add json::Value conversion from beast::String
* Update rippled-example.cfg
This commit is contained in:
Vinnie Falco
2013-07-31 07:50:34 -07:00
parent f80c19577f
commit 052aee8f97
9 changed files with 58 additions and 36 deletions

View File

@@ -470,4 +470,12 @@ void RFC1751::getEnglishFromKey (std::string& strHuman, const std::string& strKe
strHuman = strFirst + " " + strSecond;
}
// vim:ts=4
String RFC1751::getWordFromBlob (void const* data, size_t bytes)
{
uint32 hash;
Murmur::Hash (data, bytes, 0, &hash);
return s_dictionary [hash % (sizeof (s_dictionary) / sizeof (s_dictionary [0]))];
}

View File

@@ -14,6 +14,15 @@ public:
static void getEnglishFromKey (std::string& strHuman, const std::string& strKey);
/** Chooses a single dictionary word from the data.
This is not particularly secure but it can be useful to provide
a unique name for something given a GUID or fixed data. We use
it to turn the pubkey_node into an easily remembered and identified
4 character string.
*/
static String getWordFromBlob (void const* data, size_t bytes);
private:
static unsigned long extract (char* s, int start, int length);
static void btoe (std::string& strHuman, const std::string& strData);

View File

@@ -33,6 +33,7 @@ namespace ripple
#include "crypto/ripple_CBigNum.h"
#include "crypto/ripple_Base58.h" // VFALCO TODO Can be moved to .cpp if we clean up setAlphabet stuff
#include "crypto/ripple_Base58Data.h"
#include "crypto/ripple_RFC1751.h"
#include "protocol/ripple_FieldNames.h"
#include "protocol/ripple_HashPrefix.h"