From 85565b4b3235b9afa009ac1c52e034fc4c006582 Mon Sep 17 00:00:00 2001 From: Christian Wieninger Date: Sun, 6 May 2007 11:07:38 +0000 Subject: - admin password is now stored as : in live.AdminPasswordMD5 (default password keeps 'live', so please re-edit your password via OSD) - new function MD5Hash in tools - changed epgsearch to use MD5Hash of tools --- tools.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'tools.cpp') diff --git a/tools.cpp b/tools.cpp index 8959317..da3956f 100644 --- a/tools.cpp +++ b/tools.cpp @@ -4,6 +4,7 @@ #include #include #include +#include #include "exception.h" #include "live.h" #include "setup.h" @@ -130,5 +131,17 @@ string ZeroPad(int number) return os.str(); } +std::string MD5Hash(std::string const& str) +{ + unsigned char md5[MD5_DIGEST_LENGTH]; + MD5(reinterpret_cast(str.c_str()), str.size(), md5); + + ostringstream hashStr; + hashStr << hex; + for (size_t i = 0; i < MD5_DIGEST_LENGTH; i++) + hashStr << (0 + md5[i]); + + return hashStr.str(); +} } // namespace vdrlive -- cgit v1.2.3