Entropy is now calculated for Custom Alphabets in Password Generator View

Custom String in Password Generator View are now filtered to only include unique characters
This commit is contained in:
michael starke
2013-08-04 03:41:09 +02:00
parent 9d22494bf4
commit 450bc3d4dd
20 changed files with 902 additions and 279 deletions

View File

@@ -27,9 +27,16 @@
originalString:(NSString *)origString
originalSelectedRange:(NSRange)origSelRange
errorDescription:(NSString **)error {
return YES;
NSInteger newLenght = [*partialStringPtr length];
NSInteger oldLenght = [origString length];
if( oldLenght == 0 || (newLenght < oldLenght)) {
return YES;
}
NSCharacterSet *newCharacterSet = [NSCharacterSet characterSetWithCharactersInString:*partialStringPtr];
NSCharacterSet *oldCharacterSet = [NSCharacterSet characterSetWithCharactersInString:origString];
return ![oldCharacterSet isSupersetOfSet:newCharacterSet];
}
@end