>>A division mod 256 should also do the trick.
>
>Hilmar,
>Could you please post code? (My mind left for the weekend again and my body should get out of here soon to otherwise I'll be in some serious trouble with the chief<s>)
>
>I guess the big question is which is faster bitwise AND or your mod 256.
>
>Einar
The idea is to calculate
SomeInteger % 256. This will give you the remainder of the division.
I think, however, that the AND approach is more flexible: you can easily get the second-last byte, for example. With the modulus (remainder) that would require a lot more code.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)