Created
November 2, 2020 19:07
-
-
Save meyusufdemirci/3069bb11aafc79ed273b47d5aaf2e21b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class func uniqueId(length: Int) -> String { | |
let letters: String = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" | |
return String((0 ..< length).map { _ in letters.randomElement()! }) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment