Help with MD5...

I’m stuck. I want to get the MD5 hash of any FString. But I seem to hash the memory address of it or something, because I always get the same hash.
Unfortunately, my C++ skills are void. Can anybody help me what I need to change here?
Thanks!


FString myClass::GetMD5Sum(const FString& InputText)
{
	return  FMD5::HashAnsiString(UTF8_TO_TCHAR(*InputText));
}


1 Like

hi btengelh i think is just this:



        FString hello = "hello";
	FString hello2 = "Hellos";

	FString hash = FMD5::HashAnsiString(*hello);
	FString hash2 = FMD5::HashAnsiString(*hello2);



this give me hash for FString, you dont neet UTF8, fstring ansi just

1 Like

Thank you ZkarmaKun! Could get it to work the way you told.

For others:

.h


FString GetMD5Sum(FString InputText);

.cpp


FString myClass::GetMD5Sum(FString InputText)
{
	return FMD5::HashAnsiString(*InputText);
}

Pretty simple, actually. But cost me three hours to get it right :rolleyes:

1 Like