MCPcopy Create free account
hub / github.com/encodeous/nylon / UnmarshalText

Method UnmarshalText

state/serialize.go:14–21  ·  view source on GitHub ↗
(text []byte)

Source from the content-addressed store, hash-verified

12 return []byte(base64.StdEncoding.EncodeToString(k[:])), nil
13}
14func (k *NyPrivateKey) UnmarshalText(text []byte) error {
15 data, err := base64.StdEncoding.DecodeString(string(text))
16 if err != nil {
17 return fmt.Errorf("failed to decode private key: %w", err)
18 }
19 *k = NyPrivateKey(data)
20 return nil
21}
22func (k *NyPublicKey) UnmarshalText(text []byte) error {
23 data, err := base64.StdEncoding.DecodeString(string(text))
24 if err != nil {

Callers 1

TestPubkeyFunction · 0.95

Calls 1

NyPrivateKeyTypeAlias · 0.85

Tested by 1

TestPubkeyFunction · 0.76