-
-
Save cardoso/76c868e707554fc653dc1aa53728deb8 to your computer and use it in GitHub Desktop.
This file contains 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
import Foundation | |
func generateUserId(length: Int = 10) -> String { | |
let letters = "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