HexStringToByteArray() public static method

public static HexStringToByteArray ( string hex ) : byte[]
hex string
return byte[]
 public WorkBlock(JObject obj)
 {
     midstate = Program.HexStringToByteArray(obj["midstate"].ToString());
     data     = Program.HexStringToByteArray(obj["data"].ToString());
     hash1    = Program.HexStringToByteArray(obj["hash1"].ToString());
     target   = Program.HexStringToByteArray(obj["target"].ToString());
 }
        public WorkBlock(string json)
        {
            hash = new byte[32];

            JObject obj    = JObject.Parse(json);
            JObject result = JObject.Parse(obj["result"].ToString());

            midstate = Program.HexStringToByteArray(result["midstate"].ToString());
            data     = Program.HexStringToByteArray(result["data"].ToString());
            hash1    = Program.HexStringToByteArray(result["hash1"].ToString());
            target   = Program.HexStringToByteArray(result["target"].ToString());
        }