MCPcopy Index your code
hub / github.com/moby/moby / GenerateRandomID

Function GenerateRandomID

client/pkg/stringid/stringid.go:40–47  ·  view source on GitHub ↗

GenerateRandomID returns a unique, 64-character ID consisting of a-z, 0-9.

()

Source from the content-addressed store, hash-verified

38
39// GenerateRandomID returns a unique, 64-character ID consisting of a-z, 0-9.
40func GenerateRandomID() string {
41 b := make([]byte, 32)
42 if _, err := rand.Read(b); err != nil {
43 panic(err) // This shouldn't happen
44 }
45 id := hex.EncodeToString(b)
46 return id
47}

Callers 1

TestGenerateRandomIDFunction · 0.70

Calls 1

ReadMethod · 0.45

Tested by 1

TestGenerateRandomIDFunction · 0.56

Used in the wild real call sites across dependent graphs

searching dependent graphs…