🎉 Initial Commit
This commit is contained in:
14
pkg/nex/encode.go
Normal file
14
pkg/nex/encode.go
Normal file
@@ -0,0 +1,14 @@
|
||||
package nex
|
||||
|
||||
import jsoniter "github.com/json-iterator/go"
|
||||
|
||||
func EncodeMap(policy map[string]any) []byte {
|
||||
raw, _ := jsoniter.Marshal(policy)
|
||||
return raw
|
||||
}
|
||||
|
||||
func DecodeMap(raw []byte) map[string]any {
|
||||
var out map[string]any
|
||||
_ = jsoniter.Unmarshal(raw, &out)
|
||||
return out
|
||||
}
|
Reference in New Issue
Block a user