add function to generate Apple's style password

This commit is contained in:
Bob Sun 2017-02-20 21:56:23 +08:00
parent 663ccd1a85
commit 81ed04b620
No known key found for this signature in database
GPG key ID: 1F86BA2052FED3B4
3 changed files with 18 additions and 4 deletions

View file

@ -17,9 +17,6 @@ extension DefaultsKeys {
static let pgpPublicKeyArmor = DefaultsKey<String?>("pgpPublicKeyArmor")
static let pgpPrivateKeyArmor = DefaultsKey<String?>("pgpPrivateKeyArmor")
//
// static let pgpPrivateKeyURLPassphrase = DefaultsKey<String?>("pgpPrivateKeyURLPassphrase")
// static let pgpPrivateKeyArmorPassphrase = DefaultsKey<String?>("pgpPrivateKeyArmorPassphrase")
static let pgpKeyID = DefaultsKey<String?>("pgpKeyID")
static let pgpKeyUserID = DefaultsKey<String?>("pgpKeyUserID")
@ -36,5 +33,12 @@ extension DefaultsKeys {
static let passcodeKey = DefaultsKey<String?>("passcodeKey")
static let isHideUnknownOn = DefaultsKey<Bool>("isHideUnknownOn")
static let passwordGenerationMethod = DefaultsKey<String>("passwordGenerationMethod")
func initDefaultKeys() {
if Defaults[.passwordGenerationMethod] == "" {
Defaults[.passwordGenerationMethod] = "Random"
}
}
}