Skip to content

Commit

Permalink
ResourceHelper: Remove XorAlloc
Browse files Browse the repository at this point in the history
  • Loading branch information
Beyley committed Dec 28, 2023
1 parent 2215621 commit d2a8aef
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions Refresh.GameServer/Resources/ResourceHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -113,18 +113,6 @@ public static byte[] PspDecrypt(Span<byte> data, ReadOnlySpan<byte> key)
return decompressed.AsSpan().ToArray();
}

public static byte[] XorAlloc(ReadOnlySpan<byte> data, ReadOnlySpan<byte> key)
{
//Allocate the new array
byte[] result = new byte[data.Length];
//Copy the old data to the result
data.CopyTo(result);
//XOR the output array
Xor(result, key);
//Return the result
return result;
}

public static void Xor(Span<byte> data, ReadOnlySpan<byte> key)
{
if (key.Length < data.Length) throw new ArgumentException("Key must be as long or longer than the data!", nameof(key));
Expand Down

0 comments on commit d2a8aef

Please sign in to comment.