Lines Matching full:classes
92 number of characters from a set of character classes.
94 If there are n classes, and the size of each class is Pi, and the
96 passwords are (given that the character classes are disjoint):
118 } *classes; in generate_password() local
126 classes = malloc(num_classes * sizeof(*classes)); in generate_password()
127 if(classes == NULL) in generate_password()
132 classes[i].str = va_arg(ap, const char*); in generate_password()
133 classes[i].len = strlen(classes[i].str); in generate_password()
134 classes[i].freq = va_arg(ap, int); in generate_password()
135 len += classes[i].freq; in generate_password()
140 free(classes); in generate_password()
148 if(x < t + classes[j].freq) { in generate_password()
149 (*pw)[i] = classes[j].str[RND(rbuf, sizeof(rbuf), &rleft) in generate_password()
150 % classes[j].len]; in generate_password()
151 classes[j].freq--; in generate_password()
154 t += classes[j].freq; in generate_password()
159 free(classes); in generate_password()