client-dotnet/tests/INetMock.Client.Test/Hex/Converter.cs
Peter Kurfer 310428d307
Improve build process
- enable CI
- add Nuke
- fix tests path
- add DropMode for TypedReader
2021-02-16 09:36:04 +01:00

15 lines
381 B
C#

using System;
using System.Linq;
namespace INetMock.Client.Test.Hex
{
public static class Converter
{
public static byte[] HexToByteArray(this string hex) {
return Enumerable.Range(0, hex.Length)
.Where(x => x % 2 == 0)
.Select(x => Convert.ToByte(hex.Substring(x, 2), 16))
.ToArray();
}
}
}