frostfs-contract/tests/testdata/encode.go

18 lines
414 B
Go
Raw Permalink Normal View History

package testdata
import (
"git.frostfs.info/TrueCloudLab/frostfs-contract/common"
)
// EncodeDecode encodes x in fixed-width little-endian representation
// and deserializes it back.
func EncodeDecode(x int) int {
y := common.ToFixedWidth64(x)
return common.FromFixedWidth64(y)
}
// Encode encodes x in fixed-width little-endian representation.
func Encode(x int) []byte {
return common.ToFixedWidth64(x)
}