I'm coding in c/c++
is there a way to concatenate two char* fast instead of memcpy each time perhaps in c++ ??
I don't want to use strcpy/str function because its a buffer for md5 (in fact its a unsigned char*)
What does it mean to concatenate two pointers?
Perhaps the pointers refer to the first elements of two 16-byte arrays, and you want to concatenate those?
What's wrong with std::memcpy or std::memmove as appropriate?
ok.. this is kind of fail, so long as we understand that up front.
why not use c++ strings or vector of unsigned int?
if that is no good, you can roll your own. If there is a performance problem, you can multi-thread the copy and you can move at least 8 bytes at a time via casting hax (turn them into 64 bit ints). Some systems now support 16 byte ints, but that probably takes assembly language to make the efficient copy xpoit. If you multi threaded it and used the integer trick on a typical PC (4 cpu cores ) you could move at least 32 bytes at a time, and that probably happening at close to 50 to 100 million (each 32 bytes!) per second. The encryption stuff will take far longer than the bit copy stuff regardless of how you do it, but that should knock it out fast.
the bits are the same for signed or unsigned when the data is 'just bytes'. A simple cast flips between the two. So long as you are just moving it, it works either way. If you process it, it may matter, depending on what you did.
if the strings are fixed (or known for each) length, you could just store them in a single buffer that is already concat ... if the data is 'bytes'. If they are truly null terminated strings this won't work.