Created
June 29, 2017 07:26
-
-
Save Svetixbot/d723edfd06045bbf1f2e0925c6a2f40c 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
const pool = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890" | |
func generateId(n int) string { | |
b := make([]byte, n) | |
for i := range b { | |
b[i] = pool[rand.Intn(len(pool))] | |
} | |
return string(b) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment