1
2
3
4
5
6
7
8
9
10
11
12
var source = "0x42A2C6A046057454C2D1AB2CE5A0147ACF1E728E1888367CF3218A1D513C72E582DBDC7F8C4674777CA148E4EFA0B4944BB4998F446724D4F56D96B507EAE619";
var bytes = HexStringToBytes(source);

public byte[] HexStringToBytes(string source)
{
    var bytes = new List<byte>();
    for (int i = 2; i < source.Length; i += 2)
        bytes.Add(byte.Parse(source.Substring(i, 2), NumberStyles.HexNumber));

    return bytes.ToArray();
}