was spricht gegen diese Variante ohne sprintf und mit "optimierten" Datentypen ?
char HexNibble(byte b) {
b &= 0x0F; // just to protect against bad usage
if (b <= 9) return '0' + b;
return 'A'+(b-10);
}
void checksum(const char* csbuf, char *CSout) {
// Checksumme initialisieren
byte cs=0;
// Ohne führendes '
for (int n=1; n < strlen(csbuf); n++) {
// berechnen der Checksumme
cs ^= csbuf[n];
}
// Formatieren
CSout[0] = '*';
CSout[1] = HexNibble(cs >>4);
CSOut[2] = HexNibble(cs&0x0f);
CSOut[3]= 0;
}