Password entropy calculation, and tests for character set checking