mirror of
https://github.com/danbulant/Cosmos
synced 2026-05-19 12:30:32 +00:00
21 lines
518 B
C#
21 lines
518 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
|
|
namespace Cosmos.GdbClient
|
|
{
|
|
static class StringExt
|
|
{
|
|
public static byte[] GetBytes(this string hex)
|
|
{
|
|
byte[] data = new byte[hex.Length / 2];
|
|
for (int i = 0; i < hex.Length; i += 2)
|
|
{
|
|
data[i] = byte.Parse(hex.Substring(i, 2), System.Globalization.NumberStyles.HexNumber);
|
|
}
|
|
|
|
return data;
|
|
}
|
|
}
|
|
}
|