diff --git a/utils/endian.go b/utils/endian.go index d18fb3f..913a231 100644 --- a/utils/endian.go +++ b/utils/endian.go @@ -9,5 +9,8 @@ func EncodeEndian(value uint32, length int) []byte { } func DecodeEndian(byteSlice []byte) uint32 { - return binary.LittleEndian.Uint32(byteSlice) + buffer := make([]byte, 4) + copy(buffer, byteSlice) + + return binary.LittleEndian.Uint32(buffer) }