GetRandomUniqueString returns a unique random string which is n characters long plus an integer to ensure uniqueness If lower is set to true a lower case string is returned.
(n int, lower bool)
| 218 | // GetRandomUniqueString returns a unique random string which is n characters long plus an integer to ensure uniqueness |
| 219 | // If lower is set to true a lower case string is returned. |
| 220 | func GetRandomUniqueString(n int, lower bool) string { |
| 221 | StringCount++ |
| 222 | countAsString := fmt.Sprintf("%05d", StringCount) |
| 223 | if n < len(countAsString) { |
| 224 | n += len(countAsString) |
| 225 | } |
| 226 | return fmt.Sprintf("%s%s", GetRandomString(n-len(countAsString), lower), countAsString) |
| 227 | } |
| 228 | |
| 229 | const schemaBytes = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" |
| 230 |
no test coverage detected