library/src/utility/BP-StringUtilities.cc
// Simple routine to generate a MD5 Hash
Simple routine to generate a MD5 Hash
Simple routine to generate a MD5 Hash
char * BP_GenMD5(char *in, size_t in_size)
{
	if(!in && in_size)
		return NULL;
	char * md5 = (char *) bpcalloc(MD5_DIGEST_LENGTH+1, 1);
	MD5((unsigned char *) in, in_size, (unsigned char *) md5);
	char *txt_md5 = BP_BufferToHexString(md5, MD5_DIGEST_LENGTH);
	bpfree(md5);
	return txt_md5;
}
char * BP_GenMD5 ( char * in , size_t in_size ) { if ( ! in && in_size ) return NULL ; char * md5 = ( char * ) bpcalloc ( MD5_DIGEST_LENGTH + 1 , 1 ) ; MD5 ( ( unsigned char * ) in , in_size , ( unsigned char * ) md5 ) ; char * txt_md5 = BP_BufferToHexString ( md5 , MD5_DIGEST_LENGTH ) ; bpfree ( md5 ) ; return txt_md5 ; }
Simple routine to generate a MD5 Hash
Simple routine to generate a MD5 Hash
// ensure we have data to work with // allocate space for md5 // calculate the md5 sum // md5 as text // destroy the md5 // return the filled out md5 sum