Re:Htmx Is the Future
by zamadatix on Saturday May 06, 2023 @06:33AM
(#35839995)
As noted excuse the basic check functions and use whatever you actually want for check criteria and the amount of work on the server side is still 0 compared to extra effort to create a separate worse server side validation.
[ Parent
| on HN ]
Re:Htmx Is the Future
by Dylan16807 on Saturday May 06, 2023 @07:26AM
(#35840251)
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.