study this
byte mfrc522_uid_uidByte[4] = {0x35, 0xCB, 0xF8, 0xC2 };
char uidString[9]; // 4 x 2 chars for the 4 bytes + trailing '\0'
// store on 2 char the Hex represnetation of byte v
// adds a trailing '\0'
// so b should point to an array with at least 3 bytes available to contain the representation
void storeHexRepresentation(char *b, const byte v)
{
if (v <= 0xF) {
*b = '0';
b++;
}
itoa(v, b, 16); // http://www.cplusplus.com/reference/cstdlib/itoa/
}
void setup() {
Serial.begin(115200);
for (byte i = 0; i < 4; i++) storeHexRepresentation(&uidString[2 * i], mfrc522_uid_uidByte[i]);
Serial.print(F("\nYour string is:"));
Serial.println(uidString);
}
void loop() {}