]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_opersha256.cpp
XHTML 1.1 spec validation and charset
[user/henk/code/inspircd.git] / src / modules / m_opersha256.cpp
index 6437a1050613d0420e96af7c3ac754ccbe381293..0a18c32afe14c08fd2ae565afe8755c4afe291f5 100644 (file)
 using namespace std;
 
 #include <stdio.h>
+#include "inspircd_config.h"
+#ifdef HAS_STDINT
 #include <stdint.h>
+#endif
 #include "users.h"
 #include "channels.h"
 #include "modules.h"
 #include "helperfuncs.h"
 
-Server *Srv;
+static Server *Srv;
 
 #define SHA256_DIGEST_SIZE (256 / 8)
 #define SHA256_BLOCK_SIZE  (512 / 8)
 
-struct SHA256Context
+#ifndef HAS_STDINT
+typedef unsigned int uint32_t;
+#endif
+
+class SHA256Context : public classbase
 {
+ public:
        unsigned int tot_len;
        unsigned int len;
        unsigned char block[2 * SHA256_BLOCK_SIZE];
@@ -253,7 +261,7 @@ public:
                List[I_OnOperCompare] = 1;
        }
 
-       virtual int OnOperCompare(std::string data, std::string input)
+       virtual int OnOperCompare(const std::string &data, const std::string &input)
        {
                if (data.length() == SHA256_BLOCK_SIZE) // If the data is as long as a hex sha256 hash, try it as that
                {