mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-03-21 16:49:10 +01:00
use base64 alphabet directly
This commit is contained in:
parent
f69fbee6a5
commit
7c471d99c3
1 changed files with 7 additions and 6 deletions
13
NetDb.cpp
13
NetDb.cpp
|
@ -190,17 +190,17 @@ namespace data
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Random chars
|
// list of chars might appear in base64 string
|
||||||
std::string chars = "1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-~";
|
const char * chars = GetBase64SubstitutionTable ();
|
||||||
boost::filesystem::path suffix;
|
boost::filesystem::path suffix;
|
||||||
for (auto c : chars)
|
while (*chars)
|
||||||
{
|
{
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
suffix = "/r";
|
suffix = std::string ("/r") + *chars;
|
||||||
#else
|
#else
|
||||||
suffix = "\\r";
|
suffix = std::string ("\\r") + *chars;
|
||||||
#endif
|
#endif
|
||||||
suffix += c;
|
chars++;
|
||||||
if (!boost::filesystem::create_directory( boost::filesystem::path (p / suffix) )) return false;
|
if (!boost::filesystem::create_directory( boost::filesystem::path (p / suffix) )) return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@ -604,6 +604,7 @@ namespace data
|
||||||
|
|
||||||
//TODO: Move to reseed.
|
//TODO: Move to reseed.
|
||||||
//TODO: Implement v1 & v2 reseeding. Lightweight zip library is needed for v2.
|
//TODO: Implement v1 & v2 reseeding. Lightweight zip library is needed for v2.
|
||||||
|
// orignal: zip is part of crypto++, see implementation of DatabaseStoreMsg
|
||||||
//TODO: Implement SU3, utils.
|
//TODO: Implement SU3, utils.
|
||||||
void NetDb::DownloadRouterInfo (const std::string& address, const std::string& filename)
|
void NetDb::DownloadRouterInfo (const std::string& address, const std::string& filename)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue