MCPcopy Create free account
hub / github.com/Hackmanit/Web-Cache-Vulnerability-Scanner / RandomString

Function RandomString

pkg/utils.go:228–240  ·  view source on GitHub ↗

RandomString generates a random string of the specified length

(length int)

Source from the content-addressed store, hash-verified

226
227// RandomString generates a random string of the specified length
228func RandomString(length int) string {
229 const charset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
230 result := make([]byte, length)
231 for i := range result {
232 n, err := rand.Int(rand.Reader, big.NewInt(int64(len(charset))))
233 if err != nil {
234 Print(err.Error(), Red)
235 return "99999999"
236 }
237 result[i] = charset[n.Int64()]
238 }
239 return string(result)
240}
241
242func removeParam(rawURL string, paramToRemove string) (string, string, error) {
243 // Parse the URL

Callers 1

mainFunction · 0.92

Calls 1

PrintFunction · 0.85

Tested by

no test coverage detected