Initial open-source release (MIT): image2api AI gateway
Full Go backend + Vue 3 frontend, OpenAI-compatible API, multi-provider account pools, billing/admin, Docker one-command deploy with auto HTTPS. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
package service
|
||||
|
||||
import nanoid "github.com/matoous/go-nanoid/v2"
|
||||
|
||||
const UpperAlphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
||||
|
||||
func randomUpper(n int) string {
|
||||
v, err := nanoid.Generate(UpperAlphabet, n)
|
||||
if err != nil {
|
||||
if n <= 0 {
|
||||
return ""
|
||||
}
|
||||
out := make([]byte, n)
|
||||
for i := range out {
|
||||
out[i] = 'A'
|
||||
}
|
||||
return string(out)
|
||||
}
|
||||
return v
|
||||
}
|
||||
Reference in New Issue
Block a user