-
Notifications
You must be signed in to change notification settings - Fork 11
/
main.swift
36 lines (28 loc) · 946 Bytes
/
main.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
//
// main.swift
// password generator
//
// Created by Thisura Manjitha Samarakoon on 2022-10-17.
//
import Foundation
let lower_case = "bcdfghjklmnpqrstvwxyz"
let upper_case = "BCDFGHJKLMNPQRSTVWXYZ"
let vowels = "aAeEiIoOuU"
let numbers = "0123456789"
let symbols = "`-=[];,./~!@#$%^&*()_+{}|:<>?"
let length_for_password = 12
let characters = lower_case + upper_case + vowels + numbers + symbols
func passwordGenerator(inputCharacters: String, pwdLength: Int) -> String {
let inputCharactersLength = UInt32(inputCharacters.count)
var returnValue = ""
for _ in 0 ..< pwdLength {
let randomPosition = arc4random_uniform(inputCharactersLength)
//var character = inputCharacters.randomElement()
//returnValue += character
}
return returnValue
}
func readablePasswordGenerator(characters: String, length: Int) -> String {
return "hey rpw"
}
print("Hello, World!")