rob42 wrote: » When reading about computer programming such as C or Python, 0x12 mean 'the HEX number 12'. If it was just written as '12', the reader would assume the Decimal number 12, so any number that's prefixed '0x', as assumed to mean HEX notation. To understand why TCP flag==0x12 = SYN/ACK, you need to be looking at the Binary notation. 0x12 = 1 0 0 1 0 Mapping the Binary Bits to the Flag positions... NS CWR ECE URG ACK PSH RST SYN FIN 0 0 0 0 1 0 0 1 0 That's my understanding and I hope this helps you, but I'm sure someone with better knowledge than mine will correct this if I'm wrong; I am after all new to this myself. Best regards, Rob
clarson wrote: » your close but not right. each digit of a number is the base raised to a power. as for decimal (base 10). 123 is 1 x 10^2 + 2 x 10^1 + 3 x 10^0 = 100 + 20 + 3 = 123 for hex (base 16) 0x12 is 1 x 16^1 + 2 x 16^0 = 16 + 2 which in decimal that is 18 which in binary is 10010 each hex digit is 4 bits in binary, so a two digit hex number requires at least 5 bits in binary. for octal (base 8 ) 12 is 1 x 8^1 + 2 x 8^0 = 8 + 2 which in decimal is 10 and 10 in hex is 0xA in binary is 1010 but decimal 12 is 0xC in hex