12 const char* src = data;
14 std::unique_ptr<char[]> buffer(
new char[
len+1]);
23 auto base36 =
"0123456789abcdefghijklmnopqrstuvwxyz";
24 std::vector<char> out(
static_cast<size_t>(
len * 1.6) + 2 );
25 int pos = out.size() - 1;
33 }
while (
value /= _36);
34 while (
len-- > 0 && *data++ == 0) {
42 return to_base36( (
const char*)vec.data(), vec.size() );
48 std::vector<char> empty;
56 for(
auto itr = b36.rbegin(); itr != b36.rend(); ++itr )
58 if( *itr >=
'0' && *itr <=
'9' )
60 else if( *itr >=
'a' && *itr <=
'z' )
62 else if( *itr >=
'A' && *itr <=
'Z' )
72 int leading_zeros = 0,
len =
bytes.size();
73 const char *in = b36.c_str();
74 while (*in++ ==
'0') { leading_zeros++; }
75 char* first =
bytes.data();
76 while (
len > 0 && *first == 0) { first++;
len--; }
77 std::vector<char> result;
78 result.resize(leading_zeros +
len, 0);
79 memcpy( result.data() + leading_zeros, first,
len );
bigint exp(const bigint &c) const
std::vector< char > from_base36(const fc::string &b36)
std::vector< char > bytes
fc::string to_base36(const std::vector< char > &vec)
int64_t to_int64(const fc::string &)
memcpy((char *) pInfo->slotDescription, s, l)