▲ 0 r/hackthebox
How to Calculate an Octet (Decimal → Binary)
Rule: Move from left to right. Ask: "Does this value fit into the remainder?"
- Fits → write 1, subtract
- Doesn't fit → write 0, move on
Example: 192
128 ≥ 192? ✅ → 1 → remainder = 64
64 ≥ 64? ✅ → 1 → remainder = 0
32 ≥ 0? ❌ → 0
16 ≥ 0? ❌ → 0
8 ≥ 0? ❌ → 0
4 ≥ 0? ❌ → 0
2 ≥ 0? ❌ → 0
1 ≥ 0? ❌ → 0
Result: 1100 0000
Value Range of an Octet
| State | Binary | Decimal |
|---|---|---|
| Minimum | 0000 0000 | 0 |
| Maximum | 1111 1111 | 255 |
u/Qurbonmurod — 9 days ago