Converts a byte (0–255) to 2-digit uppercase hex string. Applies 0xFF mask for safety if input is out of range.
byteToHex(255) → "FF" Copy
byteToHex(255) → "FF"
byteToHex(0) → "00" Copy
byteToHex(0) → "00"
byteToHex(256) → "00" (mask applied) Copy
byteToHex(256) → "00" (mask applied)
byteToHex(-1) → "FF" (mask applied) Copy
byteToHex(-1) → "FF" (mask applied)
Converts a byte (0–255) to 2-digit uppercase hex string. Applies 0xFF mask for safety if input is out of range.