Download utils/random.go from ernoban/pplx: direct link, hf CLI and curl.
- Browser
- Download file 300 Bytes
-
https://huggingface.co/spaces/ernoban/pplx/resolve/main/utils/random.go
- Command line
-
hf download hf://spaces/ernoban/pplx/utils/random.go
-
curl -L -o random.go https://huggingface.co/spaces/ernoban/pplx/resolve/main/utils/random.go
300 Bytes
| package utils | |
| import "math/rand" | |
| func RandomString(length int) string { | |
| const charset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" | |
| result := make([]byte, length) | |
| for i := range result { | |
| result[i] = charset[rand.Intn(len(charset))] | |
| } | |
| return string(result) | |
| } | |