MCPcopy
hub / github.com/redpanda-data/console / randCryptoInts

Function randCryptoInts

backend/pkg/random/string.go:20–34  ·  view source on GitHub ↗
(length int)

Source from the content-addressed store, hash-verified

18const alphabet = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
19
20func randCryptoInts(length int) []int32 {
21 ints := make([]int32, length)
22
23 for i := range ints {
24 var data int32
25 err := binary.Read(rand.Reader, binary.BigEndian, &data)
26 if err != nil {
27 panic("crypto rand failed: " + err.Error())
28 }
29
30 ints[i] = data
31 }
32
33 return ints
34}
35
36// String returns a random string made of numbers, upper-, and lower-case letters
37func String(length int) string {

Callers 1

StringFunction · 0.85

Calls 1

ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…