mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-24 08:49:42 +00:00
Fixed #39 Overall search behavior ironed out.
Fixed #71 Added A simple entropy calculation for purely random generated passwords Added separate Views for Group and Entry Inspector Added "no Selection" view for Inpsector
This commit is contained in:
@@ -72,4 +72,15 @@ static NSString *allowedCharactersString(MPPasswordCharacterFlags flags) {
|
||||
return [self substringWithRange:NSMakeRange(randomIndex % [self length], 1)];
|
||||
}
|
||||
|
||||
- (CGFloat)entropyWhithPossibleCharacterSet:(MPPasswordCharacterFlags)allowedCharacters orCustomCharacters:(NSString *)customCharacters {
|
||||
if(nil != customCharacters) {
|
||||
return 0; // We need a sophisticated parser here!
|
||||
}
|
||||
|
||||
NSString *stringSet = allowedCharactersString(allowedCharacters);
|
||||
CGFloat alphabetCount = [stringSet length];
|
||||
CGFloat passwordLegnth = [self length];
|
||||
return passwordLegnth * ( log10(alphabetCount) / log10(2) );
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user