Comment

Comment by another-dave

Could you just iterate through the entire key even if you know it's not a match after 1 byte?

Then it would always take the same amount of time to return `true/false`, even if you knew this value earlier in the loop.

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton