MCPcopy
hub / github.com/FiloSottile/age / EncodeIdentity

Function EncodeIdentity

plugin/encode.go:19–25  ·  view source on GitHub ↗

EncodeIdentity encodes a plugin identity string for a plugin with the given name. If the name is invalid, it returns an empty string.

(name string, data []byte)

Source from the content-addressed store, hash-verified

17// EncodeIdentity encodes a plugin identity string for a plugin with the given
18// name. If the name is invalid, it returns an empty string.
19func EncodeIdentity(name string, data []byte) string {
20 if !validPluginName(name) {
21 return ""
22 }
23 s, _ := bech32.Encode("AGE-PLUGIN-"+strings.ToUpper(name)+"-", data)
24 return s
25}
26
27// ParseIdentity decodes a plugin identity string. It returns the plugin name
28// in lowercase and the encoded data.

Callers 6

convertFunction · 0.92
TestNotFoundFunction · 0.85
TestPluginErrorFunction · 0.85
NewIdentityWithoutDataFunction · 0.85

Calls 2

EncodeFunction · 0.92
validPluginNameFunction · 0.85

Tested by 2

TestNotFoundFunction · 0.68
TestPluginErrorFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…