From 936450f9e64ac01bdb12bc8353ac7fb9dfea084c Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Wed, 17 Jan 2024 10:14:56 -0500 Subject: [PATCH] fix: need to use BigEndian to encode little? --- utils/endian.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/endian.go b/utils/endian.go index 8f1c76f..b1fcbed 100644 --- a/utils/endian.go +++ b/utils/endian.go @@ -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) }