bartificer / xkpasswd-js

The official JavaScript port of the Crypt::HSXKPasswd Perl module.
https://bartificer.github.io/xkpasswd-js/
BSD 2-Clause "Simplified" License
51 stars 11 forks source link

Simplify symbol specification in config spec #85

Open bbusschots opened 5 months ago

bbusschots commented 5 months ago

For the separator and padding characters, the symbol alone can be used to infer the type:

For arrays of strings, if the strings are longer than a single character, the first character is used.

del-leehopper commented 5 months ago

As part of this enhancement, I would recommend the drop-down field "Padding Type" be set to "Use Separator Character" as default.

If you think logically, if someone has manually entered characters in the separator field, they are more likely to want to use those same characters in the padding field. Previously, I would copy/paste into that field as I didn't even realise there was a drop-down.

If someone specifically wants different padding characters, they will 'look' for this drop-down - however, someone who isn't looking for this feature will not. Hence, defaulting to "Use Separator Character" is the more logical default option.

hepabolu commented 2 months ago

@bbusschots I disagree about the inferring the type from the value of the separator char (and the padding char for that matter). That was the original setup and it gave me a headache trying to getting the code to handle this setup correctly. That's why I split the characters and the type to different variables/elements.

I do like the idea of having one element for the character/alphabet. It seems a good simplification.