class RecoveryCodeGenerator {

    public String generateCode(CodeGeneratorSource alphabet, int length) {
        Reject.ifTrue(length < 1);
        Reject.ifNull(alphabet);

        StringBuilder codeBuilder = new StringBuilder(length);
        String chars = alphabet.getChars();

        for (int k = 0; k < length; k++) {
            codeBuilder.append(chars.charAt(secureRandom.nextInt(chars.length())));
        }

        return codeBuilder.toString();
    }

    public  RecoveryCodeGenerator(SecureRandom secureRandom, int retryMaximum);
    @Inject public  RecoveryCodeGenerator(SecureRandom secureRandom);

}