summaryrefslogtreecommitdiff
path: root/src/util/string.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/string.cpp')
-rw-r--r--src/util/string.cpp23
1 files changed, 0 insertions, 23 deletions
diff --git a/src/util/string.cpp b/src/util/string.cpp
index c0f0e97fd..231eaf6be 100644
--- a/src/util/string.cpp
+++ b/src/util/string.cpp
@@ -22,12 +22,9 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "numeric.h"
#include "log.h"
-#include "sha1.h"
-#include "base64.h"
#include "hex.h"
#include "../porting.h"
-#include <algorithm>
#include <sstream>
#include <iomanip>
#include <map>
@@ -176,26 +173,6 @@ std::string wide_to_narrow(const std::wstring &wcs)
#endif
-// Get an sha-1 hash of the player's name combined with
-// the password entered. That's what the server uses as
-// their password. (Exception : if the password field is
-// blank, we send a blank password - this is for backwards
-// compatibility with password-less players).
-std::string translatePassword(const std::string &playername,
- const std::string &password)
-{
- if (password.length() == 0)
- return "";
-
- std::string slt = playername + password;
- SHA1 sha1;
- sha1.addBytes(slt.c_str(), slt.length());
- unsigned char *digest = sha1.getDigest();
- std::string pwd = base64_encode(digest, 20);
- free(digest);
- return pwd;
-}
-
std::string urlencode(std::string str)
{
// Encodes non-unreserved URI characters by a percent sign