Producing an MD5 hash of a string

What is wrong with simply using FMD5::HashAnsiString(TEXT("someStuff"));? It will give you the hash as a string in hex format, which is what you most likely will use in a header.

Hi.

I’m trying to create and MD5 hash of a string to attach as an authentication header. I Found the FMD5 implementation in the engine, but i’m not entirely sure if what i’m doing is correct and how to get to the end result.


        FString originalString = "someStuff";
	FBufferArchive BinaryArrayArchive; //i'm using this, because toBlob seems to be broken
	BinaryArrayArchive << originalString;
	
	FMD5 md5;
	md5.Update(BinaryArrayArchive.GetData(), BinaryArrayArchive.GetAllocatedSize());
	uint8 Digest[2];
	memset(Digest, 0, sizeof(Digest));
	uint8 * digest = Digest;
	md5.Final(digest);

I still need to convert it to hex through HashAnsiString, but i’m not sure if i’m on the correct track. I would greatly appreciate any help or some working code example of the process.

Nothing, it seems i just like to complicate needlessly;)

That solved it, Thanks a lot for your answer!