- HashRequest* SHA = (HashRequest*)request;
- if (strcmp("KEY", request->GetId()) == 0)
- {
- this->currkey = (unsigned int*)SHA->GetKeyData();
- }
- else if (strcmp("HEX", request->GetId()) == 0)
- {
- this->chars = SHA->GetOutputs();
- }
- else if (strcmp("SUM", request->GetId()) == 0)
- {
- static char output[MAXBUF];
- unsigned char* data = (unsigned char*)RMD((byte *)SHA->GetHashData().data(),SHA->GetHashData().length(), currkey);
- int j = 0;
- for (int i = 0; i < RMDsize / 8; i++)
- {
- output[j++] = chars[data[i] / 16];
- output[j++] = chars[data[i] % 16];
- ServerInstance->Logs->Log("m_ripemd160", DEBUG, "Hash: %02x", data[i]);
- }
- output[j] = '\0';
- return output;
- }
- else if (strcmp("NAME", request->GetId()) == 0)
- {
- return "ripemd160";
- }
- else if (strcmp("RESET", request->GetId()) == 0)
- {
- this->chars = "0123456789abcdef";
- this->currkey = NULL;
- }
- return NULL;