demo/html/benchmark.js
function WriteFteTable() {
  for (var i = 0; i < test_languages.length; i++) {
    var retval = '';
    retval += '<tr id="fte_row' + i + '">';
    retval += '<td class="obfuscatorName">fte</td>';
    retval += '<td class="testNum">' + test_languages[i]['description'] + '</td>';
    retval += '<td class="testProto">' + test_languages[i]['protocol'] + '</td>';
    retval += '<td class="testInputLanguage">(' + test_languages[i][
      'plaintext_regex'
    ].substr(0,16) + ', ' + test_languages[i]['plaintext_max_len'] + ')</td>';
    if (test_languages[i]['protocol'] == "stream cipher") {
      retval += '<td class="testInputLaguage">(^.+$, ' + test_languages[i]['ciphertext_max_len'] + ')</td>';
    } else {
      retval += '<td class="testInputLaguage">(-, ' + test_languages[i]['ciphertext_max_len'] + ')</td>';
    }
    retval += '<td class="testCost">';
    retval += '-';
    retval += '</td>';
    retval += '<td class="testBandwidth">';
    retval += '-';
    retval += '</td>';
    retval += '</tr>';

    document.getElementById('FteBenchmarkResults').innerHTML += retval;
  }
}
function WriteFteTable() {
  for (var i = 0; i < test_languages.length; i++) {
    var retval = '';
    retval += '<tr id="fte_row' + i + '">';
    retval += '<td class="obfuscatorName">fte</td>';
    retval += '<td class="testNum">' + test_languages[i]['description'] + '</td>';
    retval += '<td class="testProto">' + test_languages[i]['protocol'] + '</td>';
    retval += '<td class="testInputLanguage">(' + test_languages[i][
      'plaintext_regex'
    ].substr(0,16) + ', ' + test_languages[i]['plaintext_max_len'] + ')</td>';
    if (test_languages[i]['protocol'] == "stream cipher") {
      retval += '<td class="testInputLaguage">(^.+$, ' + test_languages[i]['ciphertext_max_len'] + ')</td>';
    } else {
      retval += '<td class="testInputLaguage">(-, ' + test_languages[i]['ciphertext_max_len'] + ')</td>';
    }
    retval += '<td class="testCost">';
    retval += '-';
    retval += '</td>';
    retval += '<td class="testBandwidth">';
    retval += '-';
    retval += '</td>';
    retval += '</tr>';

    document.getElementById('FteBenchmarkResults').innerHTML += retval;
  }
}
function WriteFteTable ( ) { for ( var i = 0 ; i < test_languages . length ; i ++ ) { var retval = '' ; retval += '<tr id="fte_row' + i + '">' ; retval += '<td class="obfuscatorName">fte</td>' ; retval += '<td class="testNum">' + test_languages [ i ] [ 'description' ] + '</td>' ; retval += '<td class="testProto">' + test_languages [ i ] [ 'protocol' ] + '</td>' ; retval += '<td class="testInputLanguage">(' + test_languages [ i ] [ 'plaintext_regex' ] . substr ( 0 , 16 ) + ', ' + test_languages [ i ] [ 'plaintext_max_len' ] + ')</td>' ; if ( test_languages [ i ] [ 'protocol' ] == "stream cipher" ) { retval += '<td class="testInputLaguage">(^.+$, ' + test_languages [ i ] [ 'ciphertext_max_len' ] + ')</td>' ; } else { retval += '<td class="testInputLaguage">(-, ' + test_languages [ i ] [ 'ciphertext_max_len' ] + ')</td>' ; } retval += '<td class="testCost">' ; retval += '-' ; retval += '</td>' ; retval += '<td class="testBandwidth">' ; retval += '-' ; retval += '</td>' ; retval += '</tr>' ; document . getElementById ( 'FteBenchmarkResults' ) . innerHTML += retval ; } }
Functions for the FTE table
Functions for the FTE table