Skip to content

yukanamori/RandomPasswordGenerator

Repository files navigation

RandomPasswordGenerator

build Swift Version Compatibility Platform Compatibility

RandomPasswordGenerator is a Swift library for generating random passwords with specified length, character types, and excluded characters.

Features

  • 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.

Installation

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")
]

Usage

import RandomPasswordGenerator

// 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) // For example: "A3b7G9k2L1"
} catch {
    print("An error occurred: \(error)")
}

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

About

Customizable Random Password Generator in Swift

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Languages