MCPcopy Create free account
hub / github.com/moby/moby / allNum

Function allNum

daemon/internal/stringid/stringid.go:63–70  ·  view source on GitHub ↗

allNum checks whether id consists of only numbers (0-9).

(id string)

Source from the content-addressed store, hash-verified

61
62// allNum checks whether id consists of only numbers (0-9).
63func allNum(id string) bool {
64 for _, c := range []byte(id) {
65 if c > '9' || c < '0' {
66 return false
67 }
68 }
69 return true
70}

Callers 2

TestAllNumFunction · 0.85
GenerateRandomIDFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestAllNumFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…