Skip to content

Commit 2755906

Browse files
committed
Remove unused Utilities.HexStringToBinary
1 parent 40a46a8 commit 2755906

File tree

2 files changed

+0
-22
lines changed

2 files changed

+0
-22
lines changed

WowPacketParser.Tests/Misc/UtilitiesTest.cs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,6 @@ public void TestGetUnixtimeFromDateTime()
2828
Assert.That(1337076610, Is.EqualTo(Utilities.GetUnixTimeFromDateTime(new DateTime(2012, 5, 15, 10, 10, 10))));
2929
}
3030

31-
[Test]
32-
public void TestHexStringToBinary()
33-
{
34-
Assert.That(new byte[0], Is.EqualTo(Utilities.HexStringToBinary(string.Empty)));
35-
Assert.That(new byte[] {1, 2, 3, 4}, Is.EqualTo(Utilities.HexStringToBinary("01020304")));
36-
Assert.That(new byte[] {255, 0}, Is.EqualTo(Utilities.HexStringToBinary("FF00")));
37-
38-
Assert.Throws<ArgumentOutOfRangeException>(() => Utilities.HexStringToBinary("B"));
39-
}
40-
4131
[Test]
4232
public void TestGetDateTimeFromGameTime()
4333
{

WowPacketParser/Misc/Utilities.cs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
using System.Collections.Concurrent;
33
using System.Collections.Generic;
44
using System.Diagnostics;
5-
using System.Globalization;
65
using System.IO;
76
using System.Linq;
87
using System.Reflection;
@@ -34,17 +33,6 @@ public static long GetUnixTimeFromDateTime(DateTime time)
3433
return ((DateTimeOffset)DateTime.SpecifyKind(time, DateTimeKind.Utc)).ToUnixTimeSeconds();
3534
}
3635

37-
public static byte[] HexStringToBinary(string data)
38-
{
39-
var bytes = new List<byte>();
40-
byte result;
41-
for (var i = 0; i < data.Length; i += 2)
42-
if (Byte.TryParse(data.Substring(i, 2), NumberStyles.HexNumber, null, out result))
43-
bytes.Add(result);
44-
45-
return bytes.ToArray();
46-
}
47-
4836
public static string ByteArrayToHexTable(byte[] data, bool sh0rt = false, int offset = 0, bool noOffsetFirstLine = true)
4937
{
5038
var n = Environment.NewLine;

0 commit comments

Comments
 (0)