fix: need to use BigEndian to encode little?

This commit is contained in:
Derrick Hammer 2024-01-17 10:14:56 -05:00
parent a708380639
commit 936450f9e6
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 2 additions and 2 deletions

View File

@ -4,7 +4,7 @@ import "encoding/binary"
func EncodeEndian(value uint64, length int) []byte {
byteSlice := make([]byte, length)
binary.LittleEndian.PutUint64(byteSlice, value)
binary.BigEndian.PutUint64(byteSlice, value)
return byteSlice
}
@ -12,5 +12,5 @@ func DecodeEndian(byteSlice []byte) uint64 {
buffer := make([]byte, 8)
copy(buffer, byteSlice)
return binary.LittleEndian.Uint64(buffer)
return binary.BigEndian.Uint64(buffer)
}