From 70a0224f1967177fa54e59276a1f92f8ae5bc17b Mon Sep 17 00:00:00 2001 From: Fabian Reinartz Date: Mon, 12 Dec 2016 08:11:53 +0100 Subject: [PATCH] Change chunk sample number to BigEndian --- chunks/chunk.go | 2 +- chunks/xor.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/chunks/chunk.go b/chunks/chunk.go index 83d346d49..eac7c06f5 100644 --- a/chunks/chunk.go +++ b/chunks/chunk.go @@ -45,7 +45,7 @@ func FromData(e Encoding, d []byte) (Chunk, error) { case EncXOR: return &XORChunk{ b: &bstream{count: 8}, - num: binary.LittleEndian.Uint16(d), + num: binary.BigEndian.Uint16(d), }, nil } return nil, fmt.Errorf("unknown chunk encoding: %d", e) diff --git a/chunks/xor.go b/chunks/xor.go index cf2648dfb..08a30ec4d 100644 --- a/chunks/xor.go +++ b/chunks/xor.go @@ -34,7 +34,7 @@ func (c *XORChunk) Bytes() []byte { b := c.b.bytes() // Lazily populate length bytes – probably not necessary to have the // cache value in struct. - binary.LittleEndian.PutUint16(b[:2], c.num) + binary.BigEndian.PutUint16(b[:2], c.num) return b }