Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Not the best, but most string comparison methods are designed to fail as soon as possible, which is not appropriate for this use case. Compare the entire input, or use some misdirection to destroy the relationship between correctness and time.

This is just one of the easier ways. It's effective and easy to code.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: