I have a bytea
column that contains 14 bytes of data. The last 3 bytes of the 14 contain the CRC code of the data. I would like to extract the CRC as a single i
Well if we're going to do byte-by-byte operations, then bit shifting is probably much more efficient than multiplication.
Based on Clodoaldo Neto's answer I would then say:
select (get_byte(arm_data, 11) << 16) |
(get_byte(arm_data, 12) << 8) |
(get_byte(arm_data, 13))
from adsb_raw_message;
Does everyone agree?