xrpld
Loading...
Searching...
No Matches
RFC1751.h
1#pragma once
2
3#include <cstddef>
4#include <string>
5#include <string_view>
6#include <vector>
7
8namespace xrpl {
9
11{
12public:
13 static int
14 getKeyFromEnglish(std::string& strKey, std::string const& strHuman);
15
16 static void
17 getEnglishFromKey(std::string& strHuman, std::string const& strKey);
18
27 static std::string
28 getWordFromBlob(void const* blob, size_t bytes);
29
30private:
31 static unsigned long
32 extract(char const* s, int start, int length);
33 static void
34 btoe(std::string& strHuman, std::string const& strData);
35 static void
36 insert(char* s, int x, int start, int length);
37 static void
38 standard(std::string& strWord);
39 static int
40 wsrch(std::string_view strWord, int iMin, int iMax);
41 static int
42 etob(std::string& strData, std::vector<std::string> vsHuman);
43
44 static char const* dictionary[];
45};
46
47} // namespace xrpl
static int wsrch(std::string_view strWord, int iMin, int iMax)
Definition RFC1751.cpp:310
static void standard(std::string &strWord)
Definition RFC1751.cpp:285
static int etob(std::string &strData, std::vector< std::string > vsHuman)
Definition RFC1751.cpp:344
static unsigned long extract(char const *s, int start, int length)
Definition RFC1751.cpp:201
static void btoe(std::string &strHuman, std::string const &strData)
Definition RFC1751.cpp:228
static void getEnglishFromKey(std::string &strHuman, std::string const &strKey)
Convert to human from a 128 bit key in big-endian format.
Definition RFC1751.cpp:423
static int getKeyFromEnglish(std::string &strKey, std::string const &strHuman)
Convert words separated by spaces into a 128 bit key in big-endian format.
Definition RFC1751.cpp:392
static std::string getWordFromBlob(void const *blob, size_t bytes)
Chooses a single dictionary word from the data.
Definition RFC1751.cpp:434
static char const * dictionary[]
Definition RFC1751.h:44
static void insert(char *s, int x, int start, int length)
Definition RFC1751.cpp:248
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5