]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_sha256.cpp
Merge insp20
[user/henk/code/inspircd.git] / src / modules / m_sha256.cpp
index 2c53e7170e605ee143613fc2ed89fa98e6dfd6c9..48bfc00410a6d62204c28376f579d3b093969c8b 100644 (file)
  * SUCH DAMAGE.
  */
 
-/* $ModDesc: Allows for SHA-256 encrypted oper passwords */
-
 #include "inspircd.h"
-#ifdef HAS_STDINT
-#include <stdint.h>
-#endif
 #include "modules/hash.h"
 
-#ifndef HAS_STDINT
-typedef unsigned int uint32_t;
-#endif
-
 #define SHA256_DIGEST_SIZE (256 / 8)
 #define SHA256_BLOCK_SIZE  (512 / 8)
 
@@ -256,14 +247,14 @@ class HashSHA256 : public HashProvider
        }
 
  public:
-       std::string sum(const std::string& data)
+       std::string GenerateRaw(const std::string& data)
        {
                unsigned char bytes[SHA256_DIGEST_SIZE];
                SHA256(data.data(), bytes, data.length());
                return std::string((char*)bytes, SHA256_DIGEST_SIZE);
        }
 
-       HashSHA256(Module* parent) : HashProvider(parent, "hash/sha256", 32, 64) {}
+       HashSHA256(Module* parent) : HashProvider(parent, "sha256", 32, 64) {}
 };
 
 class ModuleSHA256 : public Module
@@ -272,10 +263,9 @@ class ModuleSHA256 : public Module
  public:
        ModuleSHA256() : sha(this)
        {
-               ServerInstance->Modules->AddService(sha);
        }
 
-       Version GetVersion()
+       Version GetVersion() CXX11_OVERRIDE
        {
                return Version("Implements SHA-256 hashing", VF_VENDOR);
        }