MCPcopy Create free account
hub / github.com/Mnexa-AI/e2a / generateBillingID

Function generateBillingID

internal/usage/store.go:172–183  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

170}
171
172func generateBillingID() string {
173 b := make([]byte, 16)
174 if _, err := rand.Read(b); err != nil {
175 // crypto/rand failure means the OS RNG is broken — propagating
176 // would force every caller to handle an error that effectively
177 // can't happen on a healthy system. Panic so the failure is
178 // visible immediately rather than silently producing colliding
179 // all-zero IDs.
180 panic(fmt.Sprintf("billing: crypto/rand failed: %v", err))
181 }
182 return fmt.Sprintf("ue_%s", hex.EncodeToString(b))
183}
184
185// CurrentDate returns today's date as a string in YYYY-MM-DD format.
186func CurrentDate() string {

Callers 1

RecordUsageEventMethod · 0.85

Calls 1

makeFunction · 0.85

Tested by

no test coverage detected