Hello I want to know how to convert a hexadecimal array to a decimal
here's my block
uint8_t block[8] = {0xb,0xb,0xb,0xa,0xa,0xa,0xa,0xa};
here's my code
#include "stdint.h"
void main() {
uint8_t block[8] = {0xb,0xb,0xb,0xa,0xa,0xa,0xa,0xa};
uint8_t key[16] = {0xa,0xa,0xa,0xb,0xb,0xb,0xb,0xb,
0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa};
UART1_Init(9600); // Initialisation de l’UART1 à 9600 bps
UART1_Write_Text("message:");
UART1_Write_Text(block);
UART1_Write_Text(" TEA Encryption:");
TEA_Enc(block, key);
UART1_Write_Text(block);
UART1_Write_Text("TEA Decryption:");
TEA_Dec(block, key);
UART1_Write_Text(block);
}
For example if i display block i want to have as result like 123456
thank you in advance
blocki want to be in decimal if that is possibleuint8_t block[8] = {0xb,0xb...is exactly the same asuint8_t block[8] = {11,11...blockis an array that contains the numbers 11 and 10. “Decimal” is a notation in which ten symbols are used in a base-10 system. Converting hexadecimal to decimal would result in a numeral made of the digits “0” to “9”. It would not be “hello world”. Those are characters.blockis not in hexadecimal, only the way you initialised it. It contains numerica data, and decimal, binary, hexadecimal only make sense in the context of how you print the values for human consumption.