display both original and packetization byte count

This commit is contained in:
Lewis Moten
2024-05-08 15:58:20 -04:00
parent 9b24250d24
commit 37b8bd53eb
2 changed files with 6 additions and 4 deletions

View File

@@ -21,8 +21,9 @@
</div>
<div>
<h2>Data</h2>
Data Bytes: <span id="data-byte-count"></span><br>
Data Bits: <span id="data-bit-count"></span><br>
Original Bytes: <span id="original-byte-count"></span><br>
Packetization Bytes: <span id="packetization-byte-count"></span><br>
Packetization Bits: <span id="packetization-bit-count"></span><br>
Bits per Packet: <span id="packet-bit-count"></span><br>
Data Bits per Packet: <span id="packet-data-bit-count"></span><br>
Error Correction: <span id="packet-error-correction"></span><br>

View File

@@ -304,8 +304,9 @@ function updatePacketStats() {
const bits = textToBits(text);
const bitCount = getPacketizationBitCount(bits.length);
const byteCount = bitCount / 8;
document.getElementById('data-byte-count').innerText = byteCount.toLocaleString();
document.getElementById('data-bit-count').innerText = bitCount.toLocaleString();
document.getElementById('original-byte-count').innerText = textToBytes(text).length.toLocaleString();
document.getElementById('packetization-byte-count').innerText = byteCount.toLocaleString();
document.getElementById('packetization-bit-count').innerText = bitCount.toLocaleString();
document.getElementById('packet-bit-count').innerText = getPacketBitCount().toLocaleString();
document.getElementById('packet-count').innerText = getPacketCount(bitCount).toLocaleString();
document.getElementById('packet-error-correction').innerText = HAMMING_ERROR_CORRECTION ? 'Yes' : 'No';