MCPcopy Create free account
hub / github.com/53AI/53AIHub / isHashIDFormat

Function isHashIDFormat

api/middleware/relay_auth.go:359–371  ·  view source on GitHub ↗

isHashIDFormat 检查字符串是否符合hashID的一般格式(包含字母且不是纯数字)

(s string)

Source from the content-addressed store, hash-verified

357
358// isHashIDFormat 检查字符串是否符合hashID的一般格式(包含字母且不是纯数字)
359func isHashIDFormat(s string) bool {
360 if len(s) < 3 { // hashID通常比较长
361 return false
362 }
363 hasLetter := false
364 for _, char := range s {
365 if (char >= 'a' && char <= 'z') || (char >= 'A' && char <= 'Z') {
366 hasLetter = true
367 break
368 }
369 }
370 return hasLetter
371}

Callers 1

resolveAgentModelIDFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected