Nexus/pkg/nex/encode.go

15 lines
260 B
Go
Raw Normal View History

2024-10-19 14:36:33 +00:00
package nex
import jsoniter "github.com/json-iterator/go"
2024-10-20 16:05:40 +00:00
func EncodeMap(data any) []byte {
raw, _ := jsoniter.Marshal(data)
2024-10-19 14:36:33 +00:00
return raw
}
func DecodeMap(raw []byte) map[string]any {
var out map[string]any
_ = jsoniter.Unmarshal(raw, &out)
return out
}