@@ -72,9 +72,9 @@ public static void Xor(ReadOnlySpan<byte> a, ReadOnlySpan<byte> b, Span<byte> ou
7272
7373 if ( i <= output . Length - 2 )
7474 {
75- BinaryPrimitives . WriteUInt16LittleEndian ( output . Slice ( i , 2 ) ,
76- ( ushort ) ( BinaryPrimitives . ReadUInt16LittleEndian ( a . Slice ( i , 2 ) ) ^
77- BinaryPrimitives . ReadUInt16LittleEndian ( b . Slice ( i , 2 ) ) ) ) ;
75+ BinaryPrimitives . WriteUInt16BigEndian ( output . Slice ( i , 2 ) ,
76+ ( ushort ) ( BinaryPrimitives . ReadUInt16BigEndian ( a . Slice ( i , 2 ) ) ^
77+ BinaryPrimitives . ReadUInt16BigEndian ( b . Slice ( i , 2 ) ) ) ) ;
7878 i += 2 ;
7979 }
8080
@@ -124,13 +124,13 @@ public static void Xor32(Span<byte> data, uint other)
124124 [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
125125 public static void Xor16 ( Span < byte > data , ReadOnlySpan < byte > other )
126126 {
127- Xor16 ( data , BinaryPrimitives . ReadUInt16LittleEndian ( other ) ) ;
127+ Xor16 ( data , BinaryPrimitives . ReadUInt16BigEndian ( other ) ) ;
128128 }
129129
130130 [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
131131 public static void Xor16 ( Span < byte > data , ushort other )
132132 {
133- BinaryPrimitives . WriteUInt16LittleEndian ( data , ( ushort ) ( BinaryPrimitives . ReadUInt16LittleEndian ( data ) ^ other ) ) ;
133+ BinaryPrimitives . WriteUInt16BigEndian ( data , ( ushort ) ( BinaryPrimitives . ReadUInt16BigEndian ( data ) ^ other ) ) ;
134134 }
135135 }
136136}
0 commit comments