Binary Raw - Docs
    Preparing search index...

    Function bytesToAscii

    • Converts a Uint8Array to ASCII string replacing non-printable bytes with '.'. Optionally truncates to maxLen characters adding '…' at the end if there is more content.

      Used by hex-view.ts to render the ASCII column of each row.

      Parameters

      • bytes: Uint8Array

        Bytes to convert

      • maxLen: number = Infinity

        Maximum length of resulting string (not counting '…')

      Returns string

      bytesToAscii(new Uint8Array([0x25,0x50,0x44,0x46])) → "%PDF"
      
      bytesToAscii(new Uint8Array([0x41,0x00,0x42]), 2)   → "A.…"