aboutsummaryrefslogtreecommitdiff
path: root/src/mnemonics/language_base.h
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2014-10-15 12:14:44 +0200
committerRiccardo Spagni <ric@spagni.net>2014-10-15 12:14:49 +0200
commitdb5ca73fdde97ed680ef538034fb5210b45a43d4 (patch)
tree4b6d29ec984b3d7a2b06e5264249b065e71f01d8 /src/mnemonics/language_base.h
parentMerge pull request #174 (diff)
parentAdded unit test. Fails for Japanese for some reason. (diff)
downloadmonero-db5ca73fdde97ed680ef538034fb5210b45a43d4.tar.xz
Merge pull request #176
b94b8cd Added unit test. Fails for Japanese for some reason. (Oran Juice) 4c8a628 Remove iostream header put in during testing (Oran Juice) 9875f5b Variable unique prefix lengths for seed (Oran Juice)
Diffstat (limited to '')
-rw-r--r--src/mnemonics/language_base.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mnemonics/language_base.h b/src/mnemonics/language_base.h
index 0f1062b09..06815e39d 100644
--- a/src/mnemonics/language_base.h
+++ b/src/mnemonics/language_base.h
@@ -45,7 +45,6 @@
*/
namespace Language
{
- const int unique_prefix_length = 4; /*!< Length of the prefix of all words guaranteed to be unique */
/*!
* \class Base
* \brief A base language class which all languages have to inherit from for
@@ -58,7 +57,7 @@ namespace Language
std::unordered_map<std::string, uint32_t> *word_map; /*!< hash table to find word's index */
std::unordered_map<std::string, uint32_t> *trimmed_word_map; /*!< hash table to find word's trimmed index */
std::string language_name; /*!< Name of language */
- int trim_length; /*!< Number of unique starting characters to trim the wordlist to when matching */
+ uint32_t unique_prefix_length; /*!< Number of unique starting characters to trim the wordlist to when matching */
/*!
* \brief Populates the word maps after the list is ready.
*/
@@ -85,6 +84,7 @@ namespace Language
word_list = new std::vector<std::string>;
word_map = new std::unordered_map<std::string, uint32_t>;
trimmed_word_map = new std::unordered_map<std::string, uint32_t>;
+ unique_prefix_length = 4;
}
/*!
* \brief Returns a pointer to the word list.
@@ -122,9 +122,9 @@ namespace Language
* \brief Returns the number of unique starting characters to be used for matching.
* \return Number of unique starting characters.
*/
- int get_trim_length() const
+ uint32_t get_unique_prefix_length() const
{
- return trim_length;
+ return unique_prefix_length;
}
};
}