#ifndef HashMD5Crypt_class
#define HashMD5Crypt_class

#include "Hash.h"

using namespace std;

char* crypt(const char *key, const char *salt);

class HashMD5Crypt : public Hash {

	public :
		HashMD5Crypt();
		HashMD5Crypt(string,string);
		~HashMD5Crypt();
		virtual void Compute(string);

};

HashMD5Crypt::HashMD5Crypt(){
}


HashMD5Crypt::HashMD5Crypt(string p, string s){
	this->password=p;
	this->salt=s;
	this->hash="";
}

HashMD5Crypt::~HashMD5Crypt(){
}


void HashMD5Crypt::Compute(string pass){
	this->hash=crypt(pass.c_str(),this->salt.c_str());
}



// the class factories
extern "C" Hash* create() {
    	return new HashMD5Crypt;
}

extern "C" void destroy(Hash* p) {
	delete p;
}


#endif
