xrpld
Loading...
Searching...
No Matches
xrpl::RFC1751 Class Reference

#include <RFC1751.h>

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.
static void getEnglishFromKey (std::string &strHuman, std::string const &strKey)
 Convert to human from a 128 bit key in big-endian format.
static std::string getWordFromBlob (void const *blob, size_t bytes)
 Chooses a single dictionary word from the data.

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_view strWord, int iMin, int iMax)
static int etob (std::string &strData, std::vector< std::string > vsHuman)

Static Private Attributes

static char const * dictionary []

Detailed Description

Definition at line 9 of file RFC1751.h.

Member Function Documentation

◆ getKeyFromEnglish()

int xrpl::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 391 of file RFC1751.cpp.

◆ getEnglishFromKey()

void xrpl::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 421 of file RFC1751.cpp.

◆ getWordFromBlob()

std::string xrpl::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 432 of file RFC1751.cpp.

◆ extract()

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

Definition at line 201 of file RFC1751.cpp.

◆ btoe()

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

Definition at line 228 of file RFC1751.cpp.

◆ insert()

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

Definition at line 248 of file RFC1751.cpp.

◆ standard()

void xrpl::RFC1751::standard ( std::string & strWord)
staticprivate

Definition at line 285 of file RFC1751.cpp.

◆ wsrch()

int xrpl::RFC1751::wsrch ( std::string_view strWord,
int iMin,
int iMax )
staticprivate

Definition at line 310 of file RFC1751.cpp.

◆ etob()

int xrpl::RFC1751::etob ( std::string & strData,
std::vector< std::string > vsHuman )
staticprivate

Definition at line 344 of file RFC1751.cpp.

Member Data Documentation

◆ dictionary

char const * xrpl::RFC1751::dictionary
staticprivate

Definition at line 42 of file RFC1751.h.