Skip to content

Commit 0ec9816

Browse files
committed
[Core] FIx the adler32 in the ZCompression.cs
1 parent 05365b4 commit 0ec9816

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

Lagrange.Core/Utility/Compression/ZCompression.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using System.Text;
1+
using System.Buffers.Binary;
2+
using System.Text;
23

34
namespace Lagrange.Core.Utility.Compression;
45

@@ -40,6 +41,8 @@ private static byte[] Adler32(byte[] data)
4041
a = (a + t) % 65521;
4142
b = (b + a) % 65521;
4243
}
43-
return BitConverter.GetBytes(b | a << 16);
44+
var result = new byte[4];
45+
BinaryPrimitives.WriteUInt32BigEndian(result, (b << 16) | a);
46+
return result;
4447
}
4548
}

0 commit comments

Comments
 (0)