package utils

import (
	"bytes"

	jsoniter "github.com/json-iterator/go"
)

func JsonMarshal(i interface{}) ([]byte, error) {
	return jsoniter.Marshal(i)
}

func JsonUnMarshal(data []byte, i interface{}) error {
	d := jsoniter.NewDecoder(bytes.NewBuffer(data))
	d.UseNumber()
	return d.Decode(i)
}
