From 37b8bd53ebde6743f13f36bba585b9630204e347 Mon Sep 17 00:00:00 2001 From: Lewis Moten Date: Wed, 8 May 2024 15:58:20 -0400 Subject: [PATCH] display both original and packetization byte count --- index.html | 5 +++-- index.js | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/index.html b/index.html index 6bf4579..29393e7 100644 --- a/index.html +++ b/index.html @@ -21,8 +21,9 @@

Data

- Data Bytes:
- Data Bits:
+ Original Bytes:
+ Packetization Bytes:
+ Packetization Bits:
Bits per Packet:
Data Bits per Packet:
Error Correction:
diff --git a/index.js b/index.js index e67e224..496a841 100644 --- a/index.js +++ b/index.js @@ -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';