Allow PasswordGenerator to use different alphabets

Per mcilwain's suggestion in the LRP design doc, LRP tokens should use a Base58 alphabet. I'll move PasswordGenerator out of the tools package and into a utils class in a future CL, as we'll want to use this generator in the LrpToken class itself rather than relegate the token definition to a tool.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=132358363
This commit is contained in:
ctingue 2016-09-06 13:56:46 -07:00 committed by Ben McIlwain
parent dbb9ef80c5
commit daca7d65c2
14 changed files with 98 additions and 56 deletions

View file

@ -103,14 +103,14 @@ final class CreateContactCommand extends MutatingEppToolCommand implements Gtech
private String password;
@Inject
PasswordGenerator passwordGenerator;
StringGenerator passwordGenerator;
private static final int PASSWORD_LENGTH = 16;
@Override
protected void initMutatingEppToolCommand() {
if (isNullOrEmpty(password)) {
password = passwordGenerator.createPassword(PASSWORD_LENGTH);
password = passwordGenerator.createString(PASSWORD_LENGTH);
}
checkArgument(street == null || street.size() <= 3,
"Addresses must contain at most 3 street lines.");