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

Method Decode

api/common/utils/hashids/hashids.go:103–114  ·  view source on GitHub ↗

Decode 解码字符串为数字ID

(encoded string)

Source from the content-addressed store, hash-verified

101
102// Decode 解码字符串为数字ID
103func (h *HashidsManager) Decode(encoded string) (int64, error) {
104 if encoded == "" {
105 return 0, errors.New("encoded string cannot be empty")
106 }
107
108 decoded := h.sqids.Decode(encoded)
109 if len(decoded) == 0 {
110 return 0, errors.New("failed to decode string")
111 }
112
113 return int64(decoded[0]), nil
114}
115
116// EncodeMultiple 编码多个数字ID
117func (h *HashidsManager) EncodeMultiple(ids []int64) (string, error) {

Callers 15

resolveAgentModelIDFunction · 0.80
Int64Method · 0.80
parseMCPHashIDJSONFunction · 0.80
LoginFunction · 0.80
PasswordRegisterFunction · 0.80
EnterpriseAddUserFunction · 0.80
UpdateEnterpriseUserFunction · 0.80
HandleWebSearchRagFunction · 0.80
resolveKnowledgeBaseIDsFunction · 0.80
resolveFileIDsFunction · 0.80
resolveSpaceIDsFunction · 0.80

Calls 1

NewMethod · 0.45

Tested by

no test coverage detected