#125 密碼安全性檢查
Published in
Oct 3, 2020
App 在設定個人的帳號密碼時,通常都會對密碼做安全性檢查,比方以下 Twitch App 的 Sign Up 畫面。
請參考 Develop in Swift Explorations 裡 3–2 Play with Complex Data 的 Password Security,實作一個檢查密碼安全性的帳號註冊頁面。
下載電子書 Develop in Swift Explorations 後,點選以下頁面的 Download student materilas 下載書本提供的範例。(第 11 頁)
打開 Password Security.playground 後,照著檔案裡的規則實作密碼檢查。
- At least 16 characters
- at least one uppercase letter and one lowercase letter
- At least one digit
- At least one punctuation character
以下為合法的 punctuation character。
let punctuation = "!@#$%^&*(),.<>;'`~[]{}\\|/?_-+= "
- Doesn’t contain the username