Is there a library that allows me to check for the randomness of an input string? Something like:
>>> is_random_str("dfgjfgnsdfj9p5230948hfirif") -> returns True
>>> is_random_str("Hello theree") -> returns False
Is there a library that allows me to check for the randomness of an input string? Something like:
>>> is_random_str("dfgjfgnsdfj9p5230948hfirif") -> returns True
>>> is_random_str("Hello theree") -> returns False
There is a python port of zxcvbn
It will calculate entropy (guessability) but not "randomness". However, to check for "randomness" you'd first have to establish "dictionary-ness" by looking up against a dictionary of (English). Getting fewer matches means it's more random. At the core, there is this logic within zxcvbn to check against a common dictionary of 10,000 words.
There is another strategy which may be simple and what you're after. You could check for "pronounceability" and look for patterns like {{consonant}} {{vowel}} | {{double vowel:au,oo,ou}} {{ consonant }} | {{double consonant:tt,pp,th}}
Then for every violation of your defined pattern, you increase the randomness score.