fix: buffer the bytes incase its less than 4
This commit is contained in:
parent
50dd9251c2
commit
977b764904
|
@ -9,5 +9,8 @@ func EncodeEndian(value uint32, length int) []byte {
|
||||||
}
|
}
|
||||||
|
|
||||||
func DecodeEndian(byteSlice []byte) uint32 {
|
func DecodeEndian(byteSlice []byte) uint32 {
|
||||||
return binary.LittleEndian.Uint32(byteSlice)
|
buffer := make([]byte, 4)
|
||||||
|
copy(buffer, byteSlice)
|
||||||
|
|
||||||
|
return binary.LittleEndian.Uint32(buffer)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue