Observation: bswap32(16777216) == 1 bswap32(50331648) == 3 bswap32(83886080) == 5 For the second test, probably some TF thing that needs to either be configured for BE or get byte-swapped somewhere.