Hacker News new | ask | show | jobs
by Dylan16807 1136 days ago
Your check functions are fine, for both client and server.

I'm not saying not to reuse things, because I specifically think it should be two separate functions on the client, one of which is copied to the server. But if you insist on having only one client function, I think the server function should be cut down.

And the premise is doing client-only advice on strength so I'm not going to challenge that premise.

As far as 50x, your code doesn't need those consts saying the exact same thing as the results object, so that simplifies to 8 lines, and I think 400 lines for a good password estimator isn't unreasonable. zxcvbn's scoring function is around that size.