diff --git a/Friendvatars.xcodeproj/xcuserdata/dawidkubicki.xcuserdatad/xcschemes/xcschememanagement.plist b/Friendvatars.xcodeproj/xcuserdata/dawidkubicki.xcuserdatad/xcschemes/xcschememanagement.plist index 97dff02..6991e41 100644 --- a/Friendvatars.xcodeproj/xcuserdata/dawidkubicki.xcuserdatad/xcschemes/xcschememanagement.plist +++ b/Friendvatars.xcodeproj/xcuserdata/dawidkubicki.xcuserdatad/xcschemes/xcschememanagement.plist @@ -7,7 +7,7 @@ Friendvatars.xcscheme_^#shared#^_ orderHint - 2 + 3 diff --git a/Friendvatars.xcworkspace/xcuserdata/dawidkubicki.xcuserdatad/UserInterfaceState.xcuserstate b/Friendvatars.xcworkspace/xcuserdata/dawidkubicki.xcuserdatad/UserInterfaceState.xcuserstate index 1c438c5..9dc0948 100644 Binary files a/Friendvatars.xcworkspace/xcuserdata/dawidkubicki.xcuserdatad/UserInterfaceState.xcuserstate and b/Friendvatars.xcworkspace/xcuserdata/dawidkubicki.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/Friendvatars/AuthController.swift b/Friendvatars/AuthController.swift index cfef81b..75eccb3 100644 --- a/Friendvatars/AuthController.swift +++ b/Friendvatars/AuthController.swift @@ -1,6 +1,7 @@ import Foundation import CryptoSwift + final class AuthController { static let serviceName = "FriendvatarsService" @@ -18,7 +19,36 @@ final class AuthController { } } + static func random(length: Int = 20) -> String { + let base = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" + var randomString: String = "" + + for _ in 0.. String { + + func random(length: Int = 20) -> String { + let base = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" + var randomString: String = "" + + for _ in 0.. String { + let base = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" + var randomString: String = "" + + for _ in 0.. - + -