rippled
Static Public Member Functions | Static Private Member Functions | Static Private Attributes | List of all members
ripple::RFC1751 Class Reference

Static Public Member Functions

static int getKeyFromEnglish (std::string &strKey, std::string const &strHuman)
 Convert words separated by spaces into a 128 bit key in big-endian format. More...
 
static void getEnglishFromKey (std::string &strHuman, std::string const &strKey)
 Convert to human from a 128 bit key in big-endian format. More...
 
static std::string getWordFromBlob (void const *blob, size_t bytes)
 Chooses a single dictionary word from the data. More...
 

Static Private Member Functions

static unsigned long extract (char const *s, int start, int length)
 
static void btoe (std::string &strHuman, std::string const &strData)
 
static void insert (char *s, int x, int start, int length)
 
static void standard (std::string &strWord)
 
static int wsrch (std::string const &strWord, int iMin, int iMax)
 
static int etob (std::string &strData, std::vector< std::string > vsHuman)
 

Static Private Attributes

static char const * s_dictionary []
 

Detailed Description

Definition at line 28 of file RFC1751.h.

Member Function Documentation

◆ getKeyFromEnglish()

int ripple::RFC1751::getKeyFromEnglish ( std::string strKey,
std::string const &  strHuman 
)
static

Convert words separated by spaces into a 128 bit key in big-endian format.

Returns
1 if succeeded 0 if word not in dictionary -1 if badly formed string -2 if words are okay but parity is wrong.

Definition at line 450 of file RFC1751.cpp.

◆ getEnglishFromKey()

void ripple::RFC1751::getEnglishFromKey ( std::string strHuman,
std::string const &  strKey 
)
static

Convert to human from a 128 bit key in big-endian format.

Definition at line 483 of file RFC1751.cpp.

◆ getWordFromBlob()

std::string ripple::RFC1751::getWordFromBlob ( void const *  blob,
size_t  bytes 
)
static

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.

Definition at line 494 of file RFC1751.cpp.

◆ extract()

unsigned long ripple::RFC1751::extract ( char const *  s,
int  start,
int  length 
)
staticprivate

Definition at line 266 of file RFC1751.cpp.

◆ btoe()

void ripple::RFC1751::btoe ( std::string strHuman,
std::string const &  strData 
)
staticprivate

Definition at line 293 of file RFC1751.cpp.

◆ insert()

void ripple::RFC1751::insert ( char *  s,
int  x,
int  start,
int  length 
)
staticprivate

Definition at line 315 of file RFC1751.cpp.

◆ standard()

void ripple::RFC1751::standard ( std::string strWord)
staticprivate

Definition at line 352 of file RFC1751.cpp.

◆ wsrch()

int ripple::RFC1751::wsrch ( std::string const &  strWord,
int  iMin,
int  iMax 
)
staticprivate

Definition at line 369 of file RFC1751.cpp.

◆ etob()

int ripple::RFC1751::etob ( std::string strData,
std::vector< std::string vsHuman 
)
staticprivate

Definition at line 403 of file RFC1751.cpp.

Member Data Documentation

◆ s_dictionary

char const * ripple::RFC1751::s_dictionary
staticprivate

Definition at line 61 of file RFC1751.h.