- void Implements(char* List)
- {
- List[I_OnRequest] = 1;
- }
-
- virtual char* OnRequest(Request* request)
- {
- if (strcmp("MD5_SETKEY", request->GetId()) == 0)
- {
- this->key = (unsigned int*)request->GetData();
- }
- else if (strcmp("MD5_SETCHARS", request->GetId()) == 0)
- {
- this->chars = (char*)request->GetData();
- }
- else if (strcmp("MD5_SUM", request->GetId()) == 0)
- {
- static char data[MAXBUF];
- GenHash((const char*)request->GetData(), data, chars ? chars : "0123456789abcdef", key);
- return data;
- }
- else if (strcmp("MD5_RESET", request->GetId()) == 0)
- {
- this->chars = NULL;
- this->key = NULL;
- }
- return NULL;
- }
-
- virtual Version GetVersion()
- {
- return Version(1,1,0,1,VF_VENDOR,API_VERSION);
- }
+ MD5Provider(Module* parent) : HashProvider(parent, "hash/md5", 16, 64) {}