'; html += '
'; html += '字节数: ' + bytes.length + '
'; html += '字节 (hex): ' + bytes.map(function(b) { return b.toString(16).padStart(2, '0').toUpperCase(); }).join(' ') + '
'; html += 'XOR 运算: ' + bytes.map(function(b) { return '0x' + b.toString(16).padStart(2, '0').toUpperCase(); }).join(' ⊕ ') + ' = 0x' + bcc.toString(16).padStart(2, '0').toUpperCase(); html += '
'; resultContent.innerHTML = html; resultMeta.textContent = 'BCC: 0x' + bcc.toString(16).padStart(2, '0').toUpperCase(); resultArea.classList.add('show'); }); document.getElementById('btn-clear').addEventListener('click', function() { form.reset(); clearError(); clearResult(); }); })();