mirror of
https://github.com/monero-project/monero.git
synced 2025-05-06 01:45:04 -04:00
Removed some unused epee functions
This commit is contained in:
parent
9a9fb0483f
commit
7199fc8373
3 changed files with 2 additions and 726 deletions
|
@ -29,7 +29,7 @@
|
|||
#define _STRING_CODING_H_
|
||||
|
||||
#include <string>
|
||||
//#include "md5_l.h"
|
||||
|
||||
namespace epee
|
||||
{
|
||||
namespace string_encoding
|
||||
|
@ -62,23 +62,6 @@ namespace string_encoding
|
|||
(char*)str_trgt.data(), (int)str_trgt.size(), 0, 0);
|
||||
return str_trgt;*/
|
||||
}
|
||||
#ifdef WINDOWS_PLATFORM_EX
|
||||
inline std::string convert_to_ansii_win(const std::wstring& str_from)
|
||||
{
|
||||
|
||||
int code_page = CP_ACP;
|
||||
std::string str_trgt;
|
||||
if(!str_from.size())
|
||||
return str_trgt;
|
||||
int cb = ::WideCharToMultiByte( code_page, 0, str_from.data(), (__int32)str_from.size(), 0, 0, 0, 0 );
|
||||
if(!cb)
|
||||
return str_trgt;
|
||||
str_trgt.resize(cb);
|
||||
::WideCharToMultiByte( code_page, 0, str_from.data(), (int)str_from.size(),
|
||||
(char*)str_trgt.data(), (int)str_trgt.size(), 0, 0);
|
||||
return str_trgt;
|
||||
}
|
||||
#endif
|
||||
|
||||
inline std::string convert_to_ansii(const std::string& str_from)
|
||||
{
|
||||
|
@ -254,41 +237,6 @@ namespace string_encoding
|
|||
return ret;
|
||||
}
|
||||
|
||||
//md5
|
||||
#ifdef MD5_H
|
||||
inline
|
||||
std::string get_buf_as_hex_string(const void* pbuf, size_t len)
|
||||
{
|
||||
std::ostringstream result;
|
||||
|
||||
const unsigned char* p_buff = (const unsigned char*)pbuf;
|
||||
|
||||
for(unsigned int i=0;i<len;i++)
|
||||
{ // convert md to hex-represented string (hex-letters in upper case!)
|
||||
result << std::setw(2) << std::setfill('0')
|
||||
<< std::setbase(16) << std::nouppercase
|
||||
<< (int)*p_buff++;
|
||||
}
|
||||
|
||||
return result.str();
|
||||
}
|
||||
|
||||
inline
|
||||
std::string get_md5_as_hexstring(const void* pbuff, size_t len)
|
||||
{
|
||||
unsigned char output[16] = {0};
|
||||
md5::md5((unsigned char*)pbuff, static_cast<unsigned int>(len), output);
|
||||
return get_buf_as_hex_string(output, sizeof(output));
|
||||
}
|
||||
|
||||
inline
|
||||
std::string get_md5_as_hexstring(const std::string& src)
|
||||
{
|
||||
return get_md5_as_hexstring(src.data(), src.size());
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue