diff --git a/src/string.cpp b/src/string.cpp index a90388b..eb8bb9f 100644 --- a/src/string.cpp +++ b/src/string.cpp @@ -138,10 +138,14 @@ static void _l33t(strlist_t& list, const std::string& a, int pos) { } } -strlist_t l33twords(const std::string& str) { +strlist_t l33twords(std::string str) { strlist_t list; + // "l" is abit special and are not included in base58 so we set it to 1. + // All other characters in "l33t" are valid. + std::transform(str.begin(), str.end(), str.begin(), [](char c){ return c == 'l' ? '1' : c; }); + // Store the original string as the first in list. list.push_back(str); diff --git a/src/string.h b/src/string.h index d006579..b3f6300 100644 --- a/src/string.h +++ b/src/string.h @@ -44,6 +44,6 @@ std::string& trim(std::string& str); std::string& base58_strip(std::string &str); strlist_t& base58_strip(strlist_t& list); -strlist_t l33twords(const std::string& str); +strlist_t l33twords(std::string str); #endif /* STRING_H */