The general requirment is that I need to implement a method for passwords that does not accept three sequential letters or numbers - so no 'abc123' passwords.
I need a way to see if three letters are sequentially after each other - obviously with any single language this is fairly simple, but a general purpose code for every unicode language seems to escape me.
I assume first I would need a method of figuring out if the three characters are in the same language, and then figure out if they are sequentially after each other. In unicode, there are also languages that are not ordered in any particular way - so there would need to be a way to tell if we were in a language that had order or not.
Is this as complicated as I'm imagining, or are there Java libraries / inherent patterns within unicode that allow something like this?
If I were to reduce the requirements, so that I would just numerically compare the unicode numbers to each other, are there any real world scenarios that I would run into trouble with? i.e. is it likely that someone would choose a password that contained the two ending letters of one language and the first of the next, in a valid way?
If I were you I would get the unicode position of the char and check if the next character has position of the first + 1 - This should work for all languages since Unicode code points should be sorted.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With