1/** 2 * Required JavaScript for challenge/response spam protection 3 */ 4 5function getResult (method, challenge) { 6 switch (method) { 7 case '2': 8 return challenge.split('').reverse().join('') 9 case '1': 10 default: 11 return challenge.replace(/[a-z]/gi, char => 12 String.fromCharCode(char.charCodeAt(0) + (char.toUpperCase() <= 'M' ? 13 : -13)) 13 ) 14 } 15} 16 17document.addEventListener('DOMContentLoaded', () => 18{ 19 [...document.querySelectorAll('[id$="-cr-field"]')].forEach(element => 20 { 21 let [method, expiration,challenge,delay] = atob(element.value).split('|'); 22 23 if (delay === undefined) { 24 // The CR field has already been submitted by the client, but server side validation may have failed 25 return; 26 } 27 28 if (method === undefined) { 29 // If no method is defined, we fall back to the default obfuscation method 30 method = '1'; 31 } 32 33 setTimeout(() => {element.value = btoa(method + '|' + expiration + '|' + getResult(method, challenge))}, 1e3 * delay) 34 }) 35});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.