RandomPasswordGenerator is a Swift library for generating random passwords with specified length, character types, and excluded characters.
- Generate random passwords of a specified length.
- Include or exclude specific types of characters (digits, uppercase, lowercase, special characters). Special characters refer to non-space symbols in the ASCII code.
- Exclude specific characters from the generated password.
This library can be installed using the Swift Package Manager. To do so, add the following to your Package.swift file:
dependencies: [
.package(url: "https://github.com/yukanamori/RandomPasswordGenerator", from: "0.1.0")
]
import Foundation
// Create a new password generator
let generator = RandomPasswordGenerator(length: 10, characterTypes: [.digits, .uppercase, .lowercase])
do {
// Generate a random password
let password = try generator.generate()
print(password)
} catch {
print("An error occurred: \(error)")
}
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.