All challenges
Code AnalysisBeginner 60s

Trace: Timing-Safe Compare

What does timing-safe prevent?
Starter code
function sc(a, b) {
  let r = 0;
  for (let i = 0; i < a.length; i++) r |= a.charCodeAt(i) ^ b.charCodeAt(i);
  return r === 0;
}
console.log("timing attacks");

Think you can answer under pressure?

Get matched and answer live questions in 3-minute 1v1 battles. Elo ranking, badge tiers and bragging rights on the line.

Play this in a 3-minute battle