Byte Masking the ins and out

The idea of byte masking helps us achieve abstractions from the binary concept of computers to usable technology. This post helps to solidify byte masking using operators and gives examples of why we must be aware of this concept in our everyday software engineering craft.

January 17, 2024 · 4 min · Aleem Isiaka

What is Byte Masking and how useful is it?

Part of the operators we get introduced to when learning to program is Bitwise Operators, examples are: The Bitwise OR | (a single pipe character) The Bitwise AND & (a single ampersand character) The Bitwise XOR ^ (a single caret character) Each of these has its usage, a refresher can be demonstrated considering these two variables foo=1 and bar=0 For the bitwise OR(|) operator 1 2 3 const foo = 1, bar = 0 console.log(foo | bar) -> 1 For the bitwise AND(&) operator 1 2 3 const foo = 1, bar = 0 console.log(foo & bar) -> 0 For the bitwise XOR(^) operator 1 2 3 const foo = 1, bar = 0 console.log(foo & bar) -> 0 This seems pretty basic until you understand it is not. ...

September 18, 2023 · 9 min · Aleem Isiaka