See https://github.com/dropbox/zxcvbn (for the principle) and https://github.com/Privowny/zxcvbn-pv (for what I'll use, this one has built-in french l10n/i18n)