MCPcopy Create free account
hub / github.com/astercloud/aster / maskString

Function maskString

examples/mcp/main.go:175–183  ·  view source on GitHub ↗

maskString 隐藏字符串中间部分

(s string)

Source from the content-addressed store, hash-verified

173
174// maskString 隐藏字符串中间部分
175func maskString(s string) string {
176 if s == "" {
177 return "(未设置)"
178 }
179 if len(s) <= 8 {
180 return "****"
181 }
182 return s[:4] + "****" + s[len(s)-4:]
183}

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected