Const String String::toHexString () bug


#1

the function String::toHexString (const unsigned char* data, const int size, const int groupSize) produces wrong results when the groupSize is greater than 1.

the line: if (groupSize > 0 && (i % groupSize) == 0) must be: if (groupSize > 0 && (i % groupSize) == (groupSize-1) && i!=(size-1))

and the line: if (groupSize > 0) --d; must be deleted

With the present bug, the function creates hex strings like “08 d1393c10 1dbbb” <- note that there is one character missing, this was with a groupSize of 4 for 8 bytes of data!


#2

oh yes, of course… thanks, will get that checked in asap.