using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace FilterAPI.Helpers { public static class OPCodeConverter { public static Byte GetHeaderFromOPCode(UInt16 OPCode) { return (byte)(OPCode >> 10); } public static Byte GetTypeFromOPCode(UInt16 OPCode) { return (byte)(OPCode & 1023); } public static UInt16 GetOPCodeFromHeaderAndType(int Header, int Type) { return Convert.ToUInt16((Header << 10) + (Type & 1023)); } } }