func EncodeInt(b []byte, v int64) []byte {
	var data [8]byte
	u := EncodeIntToCmpUint(v)
	binary.BigEndian.PutUint64(data[:], u)
	return append(b, data[:]...)
}
EncodeInt appends the encoded value to slice b and returns the appended slice.
EncodeInt guarantees that the encoded value is in ascending order for comparison.
package codec
import (
	"encoding/binary"
	"math"
	"github.com/pingcap/errors"
)
const signMask uint64 = 0x8000000000000000
func EncodeIntToCmpUint(v int64) uint64 {
	return uint64(v) ^ signMask
}
func DecodeCmpUintToInt(u uint64) int64 {
	return int64(u ^ signMask)
}