Skip to content

Instantly share code, notes, and snippets.

@manas-sharma-1683
Created January 31, 2021 08:25
Show Gist options
  • Save manas-sharma-1683/8706e43221e7d76f6a8093347669a38a to your computer and use it in GitHub Desktop.
Save manas-sharma-1683/8706e43221e7d76f6a8093347669a38a to your computer and use it in GitHub Desktop.
Generate a random, strong password.
/*
*
* Generates a random and strong password in the format xxx-xxx-xxx-xxx.
* Note: Not available on WatchOS.
*
*/
import Security
if let password = SecCreateSharedWebCredentialPassword() as String? {
print(password)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment