replace char with uint8_t because to avoid dangerous overflows