- if (strcmp("KEY", request->GetId()) == 0)
- {
- this->key = (unsigned int*)MD5->GetKeyData();
- }
- else if (strcmp("HEX", request->GetId()) == 0)
- {
- this->chars = (char*)MD5->GetOutputs();
- }
- else if (strcmp("SUM", request->GetId()) == 0)
- {
- static char data[MAXBUF];
- GenHash(MD5->GetHashData().data(), data, chars ? chars : "0123456789abcdef", key, MD5->GetHashData().length());
- return data;
- }
- else if (strcmp("NAME", request->GetId()) == 0)
- {
- return "md5";
- }
- else if (strcmp("RESET", request->GetId()) == 0)
- {
- this->chars = NULL;
- this->key = NULL;
- }
- return NULL;
+class ModuleMD5 : public Module
+{
+ MD5Provider md5;
+ public:
+ ModuleMD5() : md5(this)
+ {
+ ServerInstance->Modules->AddService(md5);