Binary Raw - Docs
    Preparing search index...

    Function byteToHex

    • Converts a byte (0–255) to 2-digit uppercase hex string. Applies 0xFF mask for safety if input is out of range.

      Parameters

      • byte: number

      Returns string

      byteToHex(255) → "FF"
      
      byteToHex(0)   → "00"
      
      byteToHex(256) → "00" (mask applied)
      
      byteToHex(-1)  → "FF" (mask applied)