Skip to content

Commit

Permalink
Merge pull request #10 from zeoflow/docs
Browse files Browse the repository at this point in the history
improved documentation with the rebased version
  • Loading branch information
teogor authored Feb 23, 2021
2 parents 8a15377 + 8b31e90 commit 2301594
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 4 deletions.
25 changes: 23 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,29 @@ public class MainActivity extends BindAppActivity<ActivityMainBinding, MainViewB
protected void onCreate(@Nullable Bundle savedInstanceState)
{
//..
PasswordType res = initializePassChecker()
.calculateStrength("password");
// Create a map of excluded words on a per-user basis using a hypothetical "User" object that contains this info
List<Dictionary> dictionaryList = ConfigurationBuilder.getDefaultDictionaries(this);
dictionaryList.add(new DictionaryBuilder(this)
.setDictionaryName("exclude")
.setExclusion(true)
.addWord("word", 0)
.createDictionary());
// Create our configuration object and set our custom minimum
// entropy, and custom dictionary list
Configuration configuration = new ConfigurationBuilder()
.setMinimumEntropy(40d)
.setDictionaries(dictionaryList)
.createConfiguration(this);
// Create our PasswordChecker object with the configuration we built
PasswordChecker passwordChecker = new PasswordChecker(configuration);
// passwordStrength is of PasswordType type
// PasswordType can be (VERY_WEAK, WEAK, MEDIUM, STRONG, VERY_STRONG)
PasswordType passwordStrength = passwordChecker.estimate("asdasdssd").getStrength();
//..
}
//..
Expand Down
25 changes: 23 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,29 @@ public class MainActivity extends BindAppActivity<ActivityMainBinding, MainViewB
protected void onCreate(@Nullable Bundle savedInstanceState)
{
//..
PasswordType res = initializePassChecker()
.calculateStrength("password");
// Create a map of excluded words on a per-user basis using a hypothetical "User" object that contains this info
List<Dictionary> dictionaryList = ConfigurationBuilder.getDefaultDictionaries(this);
dictionaryList.add(new DictionaryBuilder(this)
.setDictionaryName("exclude")
.setExclusion(true)
.addWord("word", 0)
.createDictionary());
// Create our configuration object and set our custom minimum
// entropy, and custom dictionary list
Configuration configuration = new ConfigurationBuilder()
.setMinimumEntropy(40d)
.setDictionaries(dictionaryList)
.createConfiguration(this);
// Create our PasswordChecker object with the configuration we built
PasswordChecker passwordChecker = new PasswordChecker(configuration);
// passwordStrength is of PasswordType type
// PasswordType can be (VERY_WEAK, WEAK, MEDIUM, STRONG, VERY_STRONG)
PasswordType passwordStrength = passwordChecker.estimate("asdasdssd").getStrength();
//..
}
//..
Expand Down

0 comments on commit 2301594

Please sign in to comment.