【CRC】CRC推导(七)CRC32的各种实现

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CRC.CRC32
{
    class CRC32
    {
        /*
         *  
            Algorithm       Poly        Init       	RefIn 	RefOut 	XorOut     
            CRC-32	        0x04C11DB7	0xFFFFFFFF	true	true	0xFFFFFFFF
            CRC-32/BZIP2	0x04C11DB7	0xFFFFFFFF	false	false	0xFFFFFFFF
            CRC-32C	        0x1EDC6F41	0xFFFFFFFF	true	true	0xFFFFFFFF
            CRC-32D	        0xA833982B	0xFFFFFFFF	true	true	0xFFFFFFFF
            CRC-32/MPEG-2	0x04C11DB7	0xFFFFFFFF	false	false	0x00000000
            CRC-32/POSIX	0x04C11DB7	0x00000000	false	false	0xFFFFFFFF
            CRC-32Q	        0x814141AB	0x00000000	false	false	0x00000000
            CRC-32/JAMCRC	0x04C11DB7	0xFFFFFFFF	true	true	0x00000000
            CRC-32/XFER	    0x000000AF	0x00000000	false	false	0x00000000

         *  
         */

        public struct Scm_CRC32_InputParameters
        {
            /// 
            /// 算法名称
            /// 
            public string AlgorithmName;

            /// 
            /// 是否大端模式,
            /// 大端模式,高字节在前,左移计算,多项式无需反转
            /// 小端模式,低字节在前,右移计算,多项式需反转
            /// 
            public bool LittleEndian;

            /// 
            /// 多项式
            /// 
            public UInt32 Polynomial;

            /// 
            /// crc寄存器宽度
            /// 只读
            /// 
            public int cWidth { get { return sizeof(UInt32) / sizeof(byte) * 8; } }

            /// 
            /// 数据
            /// 
            public byte[] Datas;
            /// 
            /// 初始crc值
            /// 
            public UInt32 InitCrc;
            /// 
            /// 输入反转
            /// 
            public bool RefIn;
            /// 
            /// 输出反转
            /// 
            public bool RefOut;

            /// 
            /// 输出是否异或
            /// 
            //public bool isOutputXor;

            /// 
            /// 输出异或值
            /// 
            public UInt32 XorOut;
        }


        #region Table
        readonly UInt32[] Crc32_Poly04C11DB7_Table32_Reflect = new UInt32[256]
        {
        0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA, 0x076DC419, 0x706AF48F, 0xE963A535, 0x9E6495A3,
        0x0EDB8832, 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988, 0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, 0x90BF1D91,
        0x1DB71064, 0x6AB020F2, 0xF3B97148, 0x84BE41DE, 0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7,
        0x136C9856, 0x646BA8C0, 0xFD62F97A, 0x8A65C9EC, 0x14015C4F, 0x63066CD9, 0xFA0F3D63, 0x8D080DF5,
        0x3B6E20C8, 0x4C69105E, 0xD56041E4, 0xA2677172, 0x3C03E4D1, 0x4B04D447, 0xD20D85FD, 0xA50AB56B,
        0x35B5A8FA, 0x42B2986C, 0xDBBBC9D6, 0xACBCF940, 0x32D86CE3, 0x45DF5C75, 0xDCD60DCF, 0xABD13D59,
        0x26D930AC, 0x51DE003A, 0xC8D75180, 0xBFD06116, 0x21B4F4B5, 0x56B3C423, 0xCFBA9599, 0xB8BDA50F,
        0x2802B89E, 0x5F058808, 0xC60CD9B2, 0xB10BE924, 0x2F6F7C87, 0x58684C11, 0xC1611DAB, 0xB6662D3D,
        0x76DC4190, 0x01DB7106, 0x98D220BC, 0xEFD5102A, 0x71B18589, 0x06B6B51F, 0x9FBFE4A5, 0xE8B8D433,
        0x7807C9A2, 0x0F00F934, 0x9609A88E, 0xE10E9818, 0x7F6A0DBB, 0x086D3D2D, 0x91646C97, 0xE6635C01,
        0x6B6B51F4, 0x1C6C6162, 0x856530D8, 0xF262004E, 0x6C0695ED, 0x1B01A57B, 0x8208F4C1, 0xF50FC457,
        0x65B0D9C6, 0x12B7E950, 0x8BBEB8EA, 0xFCB9887C, 0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3, 0xFBD44C65,
        0x4DB26158, 0x3AB551CE, 0xA3BC0074, 0xD4BB30E2, 0x4ADFA541, 0x3DD895D7, 0xA4D1C46D, 0xD3D6F4FB,
        0x4369E96A, 0x346ED9FC, 0xAD678846, 0xDA60B8D0, 0x44042D73, 0x33031DE5, 0xAA0A4C5F, 0xDD0D7CC9,
        0x5005713C, 0x270241AA, 0xBE0B1010, 0xC90C2086, 0x5768B525, 0x206F85B3, 0xB966D409, 0xCE61E49F,
        0x5EDEF90E, 0x29D9C998, 0xB0D09822, 0xC7D7A8B4, 0x59B33D17, 0x2EB40D81, 0xB7BD5C3B, 0xC0BA6CAD,
        0xEDB88320, 0x9ABFB3B6, 0x03B6E20C, 0x74B1D29A, 0xEAD54739, 0x9DD277AF, 0x04DB2615, 0x73DC1683,
        0xE3630B12, 0x94643B84, 0x0D6D6A3E, 0x7A6A5AA8, 0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1,
        0xF00F9344, 0x8708A3D2, 0x1E01F268, 0x6906C2FE, 0xF762575D, 0x806567CB, 0x196C3671, 0x6E6B06E7,
        0xFED41B76, 0x89D32BE0, 0x10DA7A5A, 0x67DD4ACC, 0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5,
        0xD6D6A3E8, 0xA1D1937E, 0x38D8C2C4, 0x4FDFF252, 0xD1BB67F1, 0xA6BC5767, 0x3FB506DD, 0x48B2364B,
        0xD80D2BDA, 0xAF0A1B4C, 0x36034AF6, 0x41047A60, 0xDF60EFC3, 0xA867DF55, 0x316E8EEF, 0x4669BE79,
        0xCB61B38C, 0xBC66831A, 0x256FD2A0, 0x5268E236, 0xCC0C7795, 0xBB0B4703, 0x220216B9, 0x5505262F,
        0xC5BA3BBE, 0xB2BD0B28, 0x2BB45A92, 0x5CB36A04, 0xC2D7FFA7, 0xB5D0CF31, 0x2CD99E8B, 0x5BDEAE1D,
        0x9B64C2B0, 0xEC63F226, 0x756AA39C, 0x026D930A, 0x9C0906A9, 0xEB0E363F, 0x72076785, 0x05005713,
        0x95BF4A82, 0xE2B87A14, 0x7BB12BAE, 0x0CB61B38, 0x92D28E9B, 0xE5D5BE0D, 0x7CDCEFB7, 0x0BDBDF21,
        0x86D3D2D4, 0xF1D4E242, 0x68DDB3F8, 0x1FDA836E, 0x81BE16CD, 0xF6B9265B, 0x6FB077E1, 0x18B74777,
        0x88085AE6, 0xFF0F6A70, 0x66063BCA, 0x11010B5C, 0x8F659EFF, 0xF862AE69, 0x616BFFD3, 0x166CCF45,
        0xA00AE278, 0xD70DD2EE, 0x4E048354, 0x3903B3C2, 0xA7672661, 0xD06016F7, 0x4969474D, 0x3E6E77DB,
        0xAED16A4A, 0xD9D65ADC, 0x40DF0B66, 0x37D83BF0, 0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9,
        0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6, 0xBAD03605, 0xCDD70693, 0x54DE5729, 0x23D967BF,
        0xB3667A2E, 0xC4614AB8, 0x5D681B02, 0x2A6F2B94, 0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D
        };

        readonly UInt32[] Crc32_Poly04C11DB7_Table32 = new UInt32[256]
        {
        0x00000000, 0x04C11DB7, 0x09823B6E, 0x0D4326D9, 0x130476DC, 0x17C56B6B, 0x1A864DB2, 0x1E475005,
        0x2608EDB8, 0x22C9F00F, 0x2F8AD6D6, 0x2B4BCB61, 0x350C9B64, 0x31CD86D3, 0x3C8EA00A, 0x384FBDBD,
        0x4C11DB70, 0x48D0C6C7, 0x4593E01E, 0x4152FDA9, 0x5F15ADAC, 0x5BD4B01B, 0x569796C2, 0x52568B75,
        0x6A1936C8, 0x6ED82B7F, 0x639B0DA6, 0x675A1011, 0x791D4014, 0x7DDC5DA3, 0x709F7B7A, 0x745E66CD,
        0x9823B6E0, 0x9CE2AB57, 0x91A18D8E, 0x95609039, 0x8B27C03C, 0x8FE6DD8B, 0x82A5FB52, 0x8664E6E5,
        0xBE2B5B58, 0xBAEA46EF, 0xB7A96036, 0xB3687D81, 0xAD2F2D84, 0xA9EE3033, 0xA4AD16EA, 0xA06C0B5D,
        0xD4326D90, 0xD0F37027, 0xDDB056FE, 0xD9714B49, 0xC7361B4C, 0xC3F706FB, 0xCEB42022, 0xCA753D95,
        0xF23A8028, 0xF6FB9D9F, 0xFBB8BB46, 0xFF79A6F1, 0xE13EF6F4, 0xE5FFEB43, 0xE8BCCD9A, 0xEC7DD02D,
        0x34867077, 0x30476DC0, 0x3D044B19, 0x39C556AE, 0x278206AB, 0x23431B1C, 0x2E003DC5, 0x2AC12072,
        0x128E9DCF, 0x164F8078, 0x1B0CA6A1, 0x1FCDBB16, 0x018AEB13, 0x054BF6A4, 0x0808D07D, 0x0CC9CDCA,
        0x7897AB07, 0x7C56B6B0, 0x71159069, 0x75D48DDE, 0x6B93DDDB, 0x6F52C06C, 0x6211E6B5, 0x66D0FB02,
        0x5E9F46BF, 0x5A5E5B08, 0x571D7DD1, 0x53DC6066, 0x4D9B3063, 0x495A2DD4, 0x44190B0D, 0x40D816BA,
        0xACA5C697, 0xA864DB20, 0xA527FDF9, 0xA1E6E04E, 0xBFA1B04B, 0xBB60ADFC, 0xB6238B25, 0xB2E29692,
        0x8AAD2B2F, 0x8E6C3698, 0x832F1041, 0x87EE0DF6, 0x99A95DF3, 0x9D684044, 0x902B669D, 0x94EA7B2A,
        0xE0B41DE7, 0xE4750050, 0xE9362689, 0xEDF73B3E, 0xF3B06B3B, 0xF771768C, 0xFA325055, 0xFEF34DE2,
        0xC6BCF05F, 0xC27DEDE8, 0xCF3ECB31, 0xCBFFD686, 0xD5B88683, 0xD1799B34, 0xDC3ABDED, 0xD8FBA05A,
        0x690CE0EE, 0x6DCDFD59, 0x608EDB80, 0x644FC637, 0x7A089632, 0x7EC98B85, 0x738AAD5C, 0x774BB0EB,
        0x4F040D56, 0x4BC510E1, 0x46863638, 0x42472B8F, 0x5C007B8A, 0x58C1663D, 0x558240E4, 0x51435D53,
        0x251D3B9E, 0x21DC2629, 0x2C9F00F0, 0x285E1D47, 0x36194D42, 0x32D850F5, 0x3F9B762C, 0x3B5A6B9B,
        0x0315D626, 0x07D4CB91, 0x0A97ED48, 0x0E56F0FF, 0x1011A0FA, 0x14D0BD4D, 0x19939B94, 0x1D528623,
        0xF12F560E, 0xF5EE4BB9, 0xF8AD6D60, 0xFC6C70D7, 0xE22B20D2, 0xE6EA3D65, 0xEBA91BBC, 0xEF68060B,
        0xD727BBB6, 0xD3E6A601, 0xDEA580D8, 0xDA649D6F, 0xC423CD6A, 0xC0E2D0DD, 0xCDA1F604, 0xC960EBB3,
        0xBD3E8D7E, 0xB9FF90C9, 0xB4BCB610, 0xB07DABA7, 0xAE3AFBA2, 0xAAFBE615, 0xA7B8C0CC, 0xA379DD7B,
        0x9B3660C6, 0x9FF77D71, 0x92B45BA8, 0x9675461F, 0x8832161A, 0x8CF30BAD, 0x81B02D74, 0x857130C3,
        0x5D8A9099, 0x594B8D2E, 0x5408ABF7, 0x50C9B640, 0x4E8EE645, 0x4A4FFBF2, 0x470CDD2B, 0x43CDC09C,
        0x7B827D21, 0x7F436096, 0x7200464F, 0x76C15BF8, 0x68860BFD, 0x6C47164A, 0x61043093, 0x65C52D24,
        0x119B4BE9, 0x155A565E, 0x18197087, 0x1CD86D30, 0x029F3D35, 0x065E2082, 0x0B1D065B, 0x0FDC1BEC,
        0x3793A651, 0x3352BBE6, 0x3E119D3F, 0x3AD08088, 0x2497D08D, 0x2056CD3A, 0x2D15EBE3, 0x29D4F654,
        0xC5A92679, 0xC1683BCE, 0xCC2B1D17, 0xC8EA00A0, 0xD6AD50A5, 0xD26C4D12, 0xDF2F6BCB, 0xDBEE767C,
        0xE3A1CBC1, 0xE760D676, 0xEA23F0AF, 0xEEE2ED18, 0xF0A5BD1D, 0xF464A0AA, 0xF9278673, 0xFDE69BC4,
        0x89B8FD09, 0x8D79E0BE, 0x803AC667, 0x84FBDBD0, 0x9ABC8BD5, 0x9E7D9662, 0x933EB0BB, 0x97FFAD0C,
        0xAFB010B1, 0xAB710D06, 0xA6322BDF, 0xA2F33668, 0xBCB4666D, 0xB8757BDA, 0xB5365D03, 0xB1F740B4
        };

        readonly UInt32[] Crc32_Poly1EDC6F41_Table32_Reflect = new UInt32[256]
        {
        0x00000000, 0xF26B8303, 0xE13B70F7, 0x1350F3F4, 0xC79A971F, 0x35F1141C, 0x26A1E7E8, 0xD4CA64EB,
        0x8AD958CF, 0x78B2DBCC, 0x6BE22838, 0x9989AB3B, 0x4D43CFD0, 0xBF284CD3, 0xAC78BF27, 0x5E133C24,
        0x105EC76F, 0xE235446C, 0xF165B798, 0x030E349B, 0xD7C45070, 0x25AFD373, 0x36FF2087, 0xC494A384,
        0x9A879FA0, 0x68EC1CA3, 0x7BBCEF57, 0x89D76C54, 0x5D1D08BF, 0xAF768BBC, 0xBC267848, 0x4E4DFB4B,
        0x20BD8EDE, 0xD2D60DDD, 0xC186FE29, 0x33ED7D2A, 0xE72719C1, 0x154C9AC2, 0x061C6936, 0xF477EA35,
        0xAA64D611, 0x580F5512, 0x4B5FA6E6, 0xB93425E5, 0x6DFE410E, 0x9F95C20D, 0x8CC531F9, 0x7EAEB2FA,
        0x30E349B1, 0xC288CAB2, 0xD1D83946, 0x23B3BA45, 0xF779DEAE, 0x05125DAD, 0x1642AE59, 0xE4292D5A,
        0xBA3A117E, 0x4851927D, 0x5B016189, 0xA96AE28A, 0x7DA08661, 0x8FCB0562, 0x9C9BF696, 0x6EF07595,
        0x417B1DBC, 0xB3109EBF, 0xA0406D4B, 0x522BEE48, 0x86E18AA3, 0x748A09A0, 0x67DAFA54, 0x95B17957,
        0xCBA24573, 0x39C9C670, 0x2A993584, 0xD8F2B687, 0x0C38D26C, 0xFE53516F, 0xED03A29B, 0x1F682198,
        0x5125DAD3, 0xA34E59D0, 0xB01EAA24, 0x42752927, 0x96BF4DCC, 0x64D4CECF, 0x77843D3B, 0x85EFBE38,
        0xDBFC821C, 0x2997011F, 0x3AC7F2EB, 0xC8AC71E8, 0x1C661503, 0xEE0D9600, 0xFD5D65F4, 0x0F36E6F7,
        0x61C69362, 0x93AD1061, 0x80FDE395, 0x72966096, 0xA65C047D, 0x5437877E, 0x4767748A, 0xB50CF789,
        0xEB1FCBAD, 0x197448AE, 0x0A24BB5A, 0xF84F3859, 0x2C855CB2, 0xDEEEDFB1, 0xCDBE2C45, 0x3FD5AF46,
        0x7198540D, 0x83F3D70E, 0x90A324FA, 0x62C8A7F9, 0xB602C312, 0x44694011, 0x5739B3E5, 0xA55230E6,
        0xFB410CC2, 0x092A8FC1, 0x1A7A7C35, 0xE811FF36, 0x3CDB9BDD, 0xCEB018DE, 0xDDE0EB2A, 0x2F8B6829,
        0x82F63B78, 0x709DB87B, 0x63CD4B8F, 0x91A6C88C, 0x456CAC67, 0xB7072F64, 0xA457DC90, 0x563C5F93,
        0x082F63B7, 0xFA44E0B4, 0xE9141340, 0x1B7F9043, 0xCFB5F4A8, 0x3DDE77AB, 0x2E8E845F, 0xDCE5075C,
        0x92A8FC17, 0x60C37F14, 0x73938CE0, 0x81F80FE3, 0x55326B08, 0xA759E80B, 0xB4091BFF, 0x466298FC,
        0x1871A4D8, 0xEA1A27DB, 0xF94AD42F, 0x0B21572C, 0xDFEB33C7, 0x2D80B0C4, 0x3ED04330, 0xCCBBC033,
        0xA24BB5A6, 0x502036A5, 0x4370C551, 0xB11B4652, 0x65D122B9, 0x97BAA1BA, 0x84EA524E, 0x7681D14D,
        0x2892ED69, 0xDAF96E6A, 0xC9A99D9E, 0x3BC21E9D, 0xEF087A76, 0x1D63F975, 0x0E330A81, 0xFC588982,
        0xB21572C9, 0x407EF1CA, 0x532E023E, 0xA145813D, 0x758FE5D6, 0x87E466D5, 0x94B49521, 0x66DF1622,
        0x38CC2A06, 0xCAA7A905, 0xD9F75AF1, 0x2B9CD9F2, 0xFF56BD19, 0x0D3D3E1A, 0x1E6DCDEE, 0xEC064EED,
        0xC38D26C4, 0x31E6A5C7, 0x22B65633, 0xD0DDD530, 0x0417B1DB, 0xF67C32D8, 0xE52CC12C, 0x1747422F,
        0x49547E0B, 0xBB3FFD08, 0xA86F0EFC, 0x5A048DFF, 0x8ECEE914, 0x7CA56A17, 0x6FF599E3, 0x9D9E1AE0,
        0xD3D3E1AB, 0x21B862A8, 0x32E8915C, 0xC083125F, 0x144976B4, 0xE622F5B7, 0xF5720643, 0x07198540,
        0x590AB964, 0xAB613A67, 0xB831C993, 0x4A5A4A90, 0x9E902E7B, 0x6CFBAD78, 0x7FAB5E8C, 0x8DC0DD8F,
        0xE330A81A, 0x115B2B19, 0x020BD8ED, 0xF0605BEE, 0x24AA3F05, 0xD6C1BC06, 0xC5914FF2, 0x37FACCF1,
        0x69E9F0D5, 0x9B8273D6, 0x88D28022, 0x7AB90321, 0xAE7367CA, 0x5C18E4C9, 0x4F48173D, 0xBD23943E,
        0xF36E6F75, 0x0105EC76, 0x12551F82, 0xE03E9C81, 0x34F4F86A, 0xC69F7B69, 0xD5CF889D, 0x27A40B9E,
        0x79B737BA, 0x8BDCB4B9, 0x988C474D, 0x6AE7C44E, 0xBE2DA0A5, 0x4C4623A6, 0x5F16D052, 0xAD7D5351
        };

        readonly UInt32[] Crc32_Poly1EDC6F41_Table32 = new UInt32[256]
        {
        0x00000000, 0x1EDC6F41, 0x3DB8DE82, 0x2364B1C3, 0x7B71BD04, 0x65ADD245, 0x46C96386, 0x58150CC7,
        0xF6E37A08, 0xE83F1549, 0xCB5BA48A, 0xD587CBCB, 0x8D92C70C, 0x934EA84D, 0xB02A198E, 0xAEF676CF,
        0xF31A9B51, 0xEDC6F410, 0xCEA245D3, 0xD07E2A92, 0x886B2655, 0x96B74914, 0xB5D3F8D7, 0xAB0F9796,
        0x05F9E159, 0x1B258E18, 0x38413FDB, 0x269D509A, 0x7E885C5D, 0x6054331C, 0x433082DF, 0x5DECED9E,
        0xF8E959E3, 0xE63536A2, 0xC5518761, 0xDB8DE820, 0x8398E4E7, 0x9D448BA6, 0xBE203A65, 0xA0FC5524,
        0x0E0A23EB, 0x10D64CAA, 0x33B2FD69, 0x2D6E9228, 0x757B9EEF, 0x6BA7F1AE, 0x48C3406D, 0x561F2F2C,
        0x0BF3C2B2, 0x152FADF3, 0x364B1C30, 0x28977371, 0x70827FB6, 0x6E5E10F7, 0x4D3AA134, 0x53E6CE75,
        0xFD10B8BA, 0xE3CCD7FB, 0xC0A86638, 0xDE740979, 0x866105BE, 0x98BD6AFF, 0xBBD9DB3C, 0xA505B47D,
        0xEF0EDC87, 0xF1D2B3C6, 0xD2B60205, 0xCC6A6D44, 0x947F6183, 0x8AA30EC2, 0xA9C7BF01, 0xB71BD040,
        0x19EDA68F, 0x0731C9CE, 0x2455780D, 0x3A89174C, 0x629C1B8B, 0x7C4074CA, 0x5F24C509, 0x41F8AA48,
        0x1C1447D6, 0x02C82897, 0x21AC9954, 0x3F70F615, 0x6765FAD2, 0x79B99593, 0x5ADD2450, 0x44014B11,
        0xEAF73DDE, 0xF42B529F, 0xD74FE35C, 0xC9938C1D, 0x918680DA, 0x8F5AEF9B, 0xAC3E5E58, 0xB2E23119,
        0x17E78564, 0x093BEA25, 0x2A5F5BE6, 0x348334A7, 0x6C963860, 0x724A5721, 0x512EE6E2, 0x4FF289A3,
        0xE104FF6C, 0xFFD8902D, 0xDCBC21EE, 0xC2604EAF, 0x9A754268, 0x84A92D29, 0xA7CD9CEA, 0xB911F3AB,
        0xE4FD1E35, 0xFA217174, 0xD945C0B7, 0xC799AFF6, 0x9F8CA331, 0x8150CC70, 0xA2347DB3, 0xBCE812F2,
        0x121E643D, 0x0CC20B7C, 0x2FA6BABF, 0x317AD5FE, 0x696FD939, 0x77B3B678, 0x54D707BB, 0x4A0B68FA,
        0xC0C1D64F, 0xDE1DB90E, 0xFD7908CD, 0xE3A5678C, 0xBBB06B4B, 0xA56C040A, 0x8608B5C9, 0x98D4DA88,
        0x3622AC47, 0x28FEC306, 0x0B9A72C5, 0x15461D84, 0x4D531143, 0x538F7E02, 0x70EBCFC1, 0x6E37A080,
        0x33DB4D1E, 0x2D07225F, 0x0E63939C, 0x10BFFCDD, 0x48AAF01A, 0x56769F5B, 0x75122E98, 0x6BCE41D9,
        0xC5383716, 0xDBE45857, 0xF880E994, 0xE65C86D5, 0xBE498A12, 0xA095E553, 0x83F15490, 0x9D2D3BD1,
        0x38288FAC, 0x26F4E0ED, 0x0590512E, 0x1B4C3E6F, 0x435932A8, 0x5D855DE9, 0x7EE1EC2A, 0x603D836B,
        0xCECBF5A4, 0xD0179AE5, 0xF3732B26, 0xEDAF4467, 0xB5BA48A0, 0xAB6627E1, 0x88029622, 0x96DEF963,
        0xCB3214FD, 0xD5EE7BBC, 0xF68ACA7F, 0xE856A53E, 0xB043A9F9, 0xAE9FC6B8, 0x8DFB777B, 0x9327183A,
        0x3DD16EF5, 0x230D01B4, 0x0069B077, 0x1EB5DF36, 0x46A0D3F1, 0x587CBCB0, 0x7B180D73, 0x65C46232,
        0x2FCF0AC8, 0x31136589, 0x1277D44A, 0x0CABBB0B, 0x54BEB7CC, 0x4A62D88D, 0x6906694E, 0x77DA060F,
        0xD92C70C0, 0xC7F01F81, 0xE494AE42, 0xFA48C103, 0xA25DCDC4, 0xBC81A285, 0x9FE51346, 0x81397C07,
        0xDCD59199, 0xC209FED8, 0xE16D4F1B, 0xFFB1205A, 0xA7A42C9D, 0xB97843DC, 0x9A1CF21F, 0x84C09D5E,
        0x2A36EB91, 0x34EA84D0, 0x178E3513, 0x09525A52, 0x51475695, 0x4F9B39D4, 0x6CFF8817, 0x7223E756,
        0xD726532B, 0xC9FA3C6A, 0xEA9E8DA9, 0xF442E2E8, 0xAC57EE2F, 0xB28B816E, 0x91EF30AD, 0x8F335FEC,
        0x21C52923, 0x3F194662, 0x1C7DF7A1, 0x02A198E0, 0x5AB49427, 0x4468FB66, 0x670C4AA5, 0x79D025E4,
        0x243CC87A, 0x3AE0A73B, 0x198416F8, 0x075879B9, 0x5F4D757E, 0x41911A3F, 0x62F5ABFC, 0x7C29C4BD,
        0xD2DFB272, 0xCC03DD33, 0xEF676CF0, 0xF1BB03B1, 0xA9AE0F76, 0xB7726037, 0x9416D1F4, 0x8ACABEB5
        };

        readonly UInt32[] Crc32_PolyA833982B_Table32_Reflect = new UInt32[256]
        {
        0x00000000, 0x2BDDD04F, 0x57BBA09E, 0x7C6670D1, 0xAF77413C, 0x84AA9173, 0xF8CCE1A2, 0xD31131ED,
        0xF6DD1A53, 0xDD00CA1C, 0xA166BACD, 0x8ABB6A82, 0x59AA5B6F, 0x72778B20, 0x0E11FBF1, 0x25CC2BBE,
        0x4589AC8D, 0x6E547CC2, 0x12320C13, 0x39EFDC5C, 0xEAFEEDB1, 0xC1233DFE, 0xBD454D2F, 0x96989D60,
        0xB354B6DE, 0x98896691, 0xE4EF1640, 0xCF32C60F, 0x1C23F7E2, 0x37FE27AD, 0x4B98577C, 0x60458733,
        0x8B13591A, 0xA0CE8955, 0xDCA8F984, 0xF77529CB, 0x24641826, 0x0FB9C869, 0x73DFB8B8, 0x580268F7,
        0x7DCE4349, 0x56139306, 0x2A75E3D7, 0x01A83398, 0xD2B90275, 0xF964D23A, 0x8502A2EB, 0xAEDF72A4,
        0xCE9AF597, 0xE54725D8, 0x99215509, 0xB2FC8546, 0x61EDB4AB, 0x4A3064E4, 0x36561435, 0x1D8BC47A,
        0x3847EFC4, 0x139A3F8B, 0x6FFC4F5A, 0x44219F15, 0x9730AEF8, 0xBCED7EB7, 0xC08B0E66, 0xEB56DE29,
        0xBE152A1F, 0x95C8FA50, 0xE9AE8A81, 0xC2735ACE, 0x11626B23, 0x3ABFBB6C, 0x46D9CBBD, 0x6D041BF2,
        0x48C8304C, 0x6315E003, 0x1F7390D2, 0x34AE409D, 0xE7BF7170, 0xCC62A13F, 0xB004D1EE, 0x9BD901A1,
        0xFB9C8692, 0xD04156DD, 0xAC27260C, 0x87FAF643, 0x54EBC7AE, 0x7F3617E1, 0x03506730, 0x288DB77F,
        0x0D419CC1, 0x269C4C8E, 0x5AFA3C5F, 0x7127EC10, 0xA236DDFD, 0x89EB0DB2, 0xF58D7D63, 0xDE50AD2C,
        0x35067305, 0x1EDBA34A, 0x62BDD39B, 0x496003D4, 0x9A713239, 0xB1ACE276, 0xCDCA92A7, 0xE61742E8,
        0xC3DB6956, 0xE806B919, 0x9460C9C8, 0xBFBD1987, 0x6CAC286A, 0x4771F825, 0x3B1788F4, 0x10CA58BB,
        0x708FDF88, 0x5B520FC7, 0x27347F16, 0x0CE9AF59, 0xDFF89EB4, 0xF4254EFB, 0x88433E2A, 0xA39EEE65,
        0x8652C5DB, 0xAD8F1594, 0xD1E96545, 0xFA34B50A, 0x292584E7, 0x02F854A8, 0x7E9E2479, 0x5543F436,
        0xD419CC15, 0xFFC41C5A, 0x83A26C8B, 0xA87FBCC4, 0x7B6E8D29, 0x50B35D66, 0x2CD52DB7, 0x0708FDF8,
        0x22C4D646, 0x09190609, 0x757F76D8, 0x5EA2A697, 0x8DB3977A, 0xA66E4735, 0xDA0837E4, 0xF1D5E7AB,
        0x91906098, 0xBA4DB0D7, 0xC62BC006, 0xEDF61049, 0x3EE721A4, 0x153AF1EB, 0x695C813A, 0x42815175,
        0x674D7ACB, 0x4C90AA84, 0x30F6DA55, 0x1B2B0A1A, 0xC83A3BF7, 0xE3E7EBB8, 0x9F819B69, 0xB45C4B26,
        0x5F0A950F, 0x74D74540, 0x08B13591, 0x236CE5DE, 0xF07DD433, 0xDBA0047C, 0xA7C674AD, 0x8C1BA4E2,
        0xA9D78F5C, 0x820A5F13, 0xFE6C2FC2, 0xD5B1FF8D, 0x06A0CE60, 0x2D7D1E2F, 0x511B6EFE, 0x7AC6BEB1,
        0x1A833982, 0x315EE9CD, 0x4D38991C, 0x66E54953, 0xB5F478BE, 0x9E29A8F1, 0xE24FD820, 0xC992086F,
        0xEC5E23D1, 0xC783F39E, 0xBBE5834F, 0x90385300, 0x432962ED, 0x68F4B2A2, 0x1492C273, 0x3F4F123C,
        0x6A0CE60A, 0x41D13645, 0x3DB74694, 0x166A96DB, 0xC57BA736, 0xEEA67779, 0x92C007A8, 0xB91DD7E7,
        0x9CD1FC59, 0xB70C2C16, 0xCB6A5CC7, 0xE0B78C88, 0x33A6BD65, 0x187B6D2A, 0x641D1DFB, 0x4FC0CDB4,
        0x2F854A87, 0x04589AC8, 0x783EEA19, 0x53E33A56, 0x80F20BBB, 0xAB2FDBF4, 0xD749AB25, 0xFC947B6A,
        0xD95850D4, 0xF285809B, 0x8EE3F04A, 0xA53E2005, 0x762F11E8, 0x5DF2C1A7, 0x2194B176, 0x0A496139,
        0xE11FBF10, 0xCAC26F5F, 0xB6A41F8E, 0x9D79CFC1, 0x4E68FE2C, 0x65B52E63, 0x19D35EB2, 0x320E8EFD,
        0x17C2A543, 0x3C1F750C, 0x407905DD, 0x6BA4D592, 0xB8B5E47F, 0x93683430, 0xEF0E44E1, 0xC4D394AE,
        0xA496139D, 0x8F4BC3D2, 0xF32DB303, 0xD8F0634C, 0x0BE152A1, 0x203C82EE, 0x5C5AF23F, 0x77872270,
        0x524B09CE, 0x7996D981, 0x05F0A950, 0x2E2D791F, 0xFD3C48F2, 0xD6E198BD, 0xAA87E86C, 0x815A3823
        };

        readonly UInt32[] Crc32_PolyA833982B_Table32 = new UInt32[256]
        {
        0x00000000, 0xA833982B, 0xF854A87D, 0x50673056, 0x589AC8D1, 0xF0A950FA, 0xA0CE60AC, 0x08FDF887,
        0xB13591A2, 0x19060989, 0x496139DF, 0xE152A1F4, 0xE9AF5973, 0x419CC158, 0x11FBF10E, 0xB9C86925,
        0xCA58BB6F, 0x626B2344, 0x320C1312, 0x9A3F8B39, 0x92C273BE, 0x3AF1EB95, 0x6A96DBC3, 0xC2A543E8,
        0x7B6D2ACD, 0xD35EB2E6, 0x833982B0, 0x2B0A1A9B, 0x23F7E21C, 0x8BC47A37, 0xDBA34A61, 0x7390D24A,
        0x3C82EEF5, 0x94B176DE, 0xC4D64688, 0x6CE5DEA3, 0x64182624, 0xCC2BBE0F, 0x9C4C8E59, 0x347F1672,
        0x8DB77F57, 0x2584E77C, 0x75E3D72A, 0xDDD04F01, 0xD52DB786, 0x7D1E2FAD, 0x2D791FFB, 0x854A87D0,
        0xF6DA559A, 0x5EE9CDB1, 0x0E8EFDE7, 0xA6BD65CC, 0xAE409D4B, 0x06730560, 0x56143536, 0xFE27AD1D,
        0x47EFC438, 0xEFDC5C13, 0xBFBB6C45, 0x1788F46E, 0x1F750CE9, 0xB74694C2, 0xE721A494, 0x4F123CBF,
        0x7905DDEA, 0xD13645C1, 0x81517597, 0x2962EDBC, 0x219F153B, 0x89AC8D10, 0xD9CBBD46, 0x71F8256D,
        0xC8304C48, 0x6003D463, 0x3064E435, 0x98577C1E, 0x90AA8499, 0x38991CB2, 0x68FE2CE4, 0xC0CDB4CF,
        0xB35D6685, 0x1B6EFEAE, 0x4B09CEF8, 0xE33A56D3, 0xEBC7AE54, 0x43F4367F, 0x13930629, 0xBBA09E02,
        0x0268F727, 0xAA5B6F0C, 0xFA3C5F5A, 0x520FC771, 0x5AF23FF6, 0xF2C1A7DD, 0xA2A6978B, 0x0A950FA0,
        0x4587331F, 0xEDB4AB34, 0xBDD39B62, 0x15E00349, 0x1D1DFBCE, 0xB52E63E5, 0xE54953B3, 0x4D7ACB98,
        0xF4B2A2BD, 0x5C813A96, 0x0CE60AC0, 0xA4D592EB, 0xAC286A6C, 0x041BF247, 0x547CC211, 0xFC4F5A3A,
        0x8FDF8870, 0x27EC105B, 0x778B200D, 0xDFB8B826, 0xD74540A1, 0x7F76D88A, 0x2F11E8DC, 0x872270F7,
        0x3EEA19D2, 0x96D981F9, 0xC6BEB1AF, 0x6E8D2984, 0x6670D103, 0xCE434928, 0x9E24797E, 0x3617E155,
        0xF20BBBD4, 0x5A3823FF, 0x0A5F13A9, 0xA26C8B82, 0xAA917305, 0x02A2EB2E, 0x52C5DB78, 0xFAF64353,
        0x433E2A76, 0xEB0DB25D, 0xBB6A820B, 0x13591A20, 0x1BA4E2A7, 0xB3977A8C, 0xE3F04ADA, 0x4BC3D2F1,
        0x385300BB, 0x90609890, 0xC007A8C6, 0x683430ED, 0x60C9C86A, 0xC8FA5041, 0x989D6017, 0x30AEF83C,
        0x89669119, 0x21550932, 0x71323964, 0xD901A14F, 0xD1FC59C8, 0x79CFC1E3, 0x29A8F1B5, 0x819B699E,
        0xCE895521, 0x66BACD0A, 0x36DDFD5C, 0x9EEE6577, 0x96139DF0, 0x3E2005DB, 0x6E47358D, 0xC674ADA6,
        0x7FBCC483, 0xD78F5CA8, 0x87E86CFE, 0x2FDBF4D5, 0x27260C52, 0x8F159479, 0xDF72A42F, 0x77413C04,
        0x04D1EE4E, 0xACE27665, 0xFC854633, 0x54B6DE18, 0x5C4B269F, 0xF478BEB4, 0xA41F8EE2, 0x0C2C16C9,
        0xB5E47FEC, 0x1DD7E7C7, 0x4DB0D791, 0xE5834FBA, 0xED7EB73D, 0x454D2F16, 0x152A1F40, 0xBD19876B,
        0x8B0E663E, 0x233DFE15, 0x735ACE43, 0xDB695668, 0xD394AEEF, 0x7BA736C4, 0x2BC00692, 0x83F39EB9,
        0x3A3BF79C, 0x92086FB7, 0xC26F5FE1, 0x6A5CC7CA, 0x62A13F4D, 0xCA92A766, 0x9AF59730, 0x32C60F1B,
        0x4156DD51, 0xE965457A, 0xB902752C, 0x1131ED07, 0x19CC1580, 0xB1FF8DAB, 0xE198BDFD, 0x49AB25D6,
        0xF0634CF3, 0x5850D4D8, 0x0837E48E, 0xA0047CA5, 0xA8F98422, 0x00CA1C09, 0x50AD2C5F, 0xF89EB474,
        0xB78C88CB, 0x1FBF10E0, 0x4FD820B6, 0xE7EBB89D, 0xEF16401A, 0x4725D831, 0x1742E867, 0xBF71704C,
        0x06B91969, 0xAE8A8142, 0xFEEDB114, 0x56DE293F, 0x5E23D1B8, 0xF6104993, 0xA67779C5, 0x0E44E1EE,
        0x7DD433A4, 0xD5E7AB8F, 0x85809BD9, 0x2DB303F2, 0x254EFB75, 0x8D7D635E, 0xDD1A5308, 0x7529CB23,
        0xCCE1A206, 0x64D23A2D, 0x34B50A7B, 0x9C869250, 0x947B6AD7, 0x3C48F2FC, 0x6C2FC2AA, 0xC41C5A81
        };

        readonly UInt32[] Crc32_Poly814141AB_Table32_Reflect = new UInt32[256]
        {
        0x00000000, 0x999A0002, 0x98310507, 0x01AB0505, 0x9B670F0D, 0x02FD0F0F, 0x03560A0A, 0x9ACC0A08,
        0x9DCB1B19, 0x04511B1B, 0x05FA1E1E, 0x9C601E1C, 0x06AC1414, 0x9F361416, 0x9E9D1113, 0x07071111,
        0x90933331, 0x09093333, 0x08A23636, 0x91383634, 0x0BF43C3C, 0x926E3C3E, 0x93C5393B, 0x0A5F3939,
        0x0D582828, 0x94C2282A, 0x95692D2F, 0x0CF32D2D, 0x963F2725, 0x0FA52727, 0x0E0E2222, 0x97942220,
        0x8A236361, 0x13B96363, 0x12126666, 0x8B886664, 0x11446C6C, 0x88DE6C6E, 0x8975696B, 0x10EF6969,
        0x17E87878, 0x8E72787A, 0x8FD97D7F, 0x16437D7D, 0x8C8F7775, 0x15157777, 0x14BE7272, 0x8D247270,
        0x1AB05050, 0x832A5052, 0x82815557, 0x1B1B5555, 0x81D75F5D, 0x184D5F5F, 0x19E65A5A, 0x807C5A58,
        0x877B4B49, 0x1EE14B4B, 0x1F4A4E4E, 0x86D04E4C, 0x1C1C4444, 0x85864446, 0x842D4143, 0x1DB74141,
        0xBF43C3C1, 0x26D9C3C3, 0x2772C6C6, 0xBEE8C6C4, 0x2424CCCC, 0xBDBECCCE, 0xBC15C9CB, 0x258FC9C9,
        0x2288D8D8, 0xBB12D8DA, 0xBAB9DDDF, 0x2323DDDD, 0xB9EFD7D5, 0x2075D7D7, 0x21DED2D2, 0xB844D2D0,
        0x2FD0F0F0, 0xB64AF0F2, 0xB7E1F5F7, 0x2E7BF5F5, 0xB4B7FFFD, 0x2D2DFFFF, 0x2C86FAFA, 0xB51CFAF8,
        0xB21BEBE9, 0x2B81EBEB, 0x2A2AEEEE, 0xB3B0EEEC, 0x297CE4E4, 0xB0E6E4E6, 0xB14DE1E3, 0x28D7E1E1,
        0x3560A0A0, 0xACFAA0A2, 0xAD51A5A7, 0x34CBA5A5, 0xAE07AFAD, 0x379DAFAF, 0x3636AAAA, 0xAFACAAA8,
        0xA8ABBBB9, 0x3131BBBB, 0x309ABEBE, 0xA900BEBC, 0x33CCB4B4, 0xAA56B4B6, 0xABFDB1B3, 0x3267B1B1,
        0xA5F39391, 0x3C699393, 0x3DC29696, 0xA4589694, 0x3E949C9C, 0xA70E9C9E, 0xA6A5999B, 0x3F3F9999,
        0x38388888, 0xA1A2888A, 0xA0098D8F, 0x39938D8D, 0xA35F8785, 0x3AC58787, 0x3B6E8282, 0xA2F48280,
        0xD5828281, 0x4C188283, 0x4DB38786, 0xD4298784, 0x4EE58D8C, 0xD77F8D8E, 0xD6D4888B, 0x4F4E8889,
        0x48499998, 0xD1D3999A, 0xD0789C9F, 0x49E29C9D, 0xD32E9695, 0x4AB49697, 0x4B1F9392, 0xD2859390,
        0x4511B1B0, 0xDC8BB1B2, 0xDD20B4B7, 0x44BAB4B5, 0xDE76BEBD, 0x47ECBEBF, 0x4647BBBA, 0xDFDDBBB8,
        0xD8DAAAA9, 0x4140AAAB, 0x40EBAFAE, 0xD971AFAC, 0x43BDA5A4, 0xDA27A5A6, 0xDB8CA0A3, 0x4216A0A1,
        0x5FA1E1E0, 0xC63BE1E2, 0xC790E4E7, 0x5E0AE4E5, 0xC4C6EEED, 0x5D5CEEEF, 0x5CF7EBEA, 0xC56DEBE8,
        0xC26AFAF9, 0x5BF0FAFB, 0x5A5BFFFE, 0xC3C1FFFC, 0x590DF5F4, 0xC097F5F6, 0xC13CF0F3, 0x58A6F0F1,
        0xCF32D2D1, 0x56A8D2D3, 0x5703D7D6, 0xCE99D7D4, 0x5455DDDC, 0xCDCFDDDE, 0xCC64D8DB, 0x55FED8D9,
        0x52F9C9C8, 0xCB63C9CA, 0xCAC8CCCF, 0x5352CCCD, 0xC99EC6C5, 0x5004C6C7, 0x51AFC3C2, 0xC835C3C0,
        0x6AC14140, 0xF35B4142, 0xF2F04447, 0x6B6A4445, 0xF1A64E4D, 0x683C4E4F, 0x69974B4A, 0xF00D4B48,
        0xF70A5A59, 0x6E905A5B, 0x6F3B5F5E, 0xF6A15F5C, 0x6C6D5554, 0xF5F75556, 0xF45C5053, 0x6DC65051,
        0xFA527271, 0x63C87273, 0x62637776, 0xFBF97774, 0x61357D7C, 0xF8AF7D7E, 0xF904787B, 0x609E7879,
        0x67996968, 0xFE03696A, 0xFFA86C6F, 0x66326C6D, 0xFCFE6665, 0x65646667, 0x64CF6362, 0xFD556360,
        0xE0E22221, 0x79782223, 0x78D32726, 0xE1492724, 0x7B852D2C, 0xE21F2D2E, 0xE3B4282B, 0x7A2E2829,
        0x7D293938, 0xE4B3393A, 0xE5183C3F, 0x7C823C3D, 0xE64E3635, 0x7FD43637, 0x7E7F3332, 0xE7E53330,
        0x70711110, 0xE9EB1112, 0xE8401417, 0x71DA1415, 0xEB161E1D, 0x728C1E1F, 0x73271B1A, 0xEABD1B18,
        0xEDBA0A09, 0x74200A0B, 0x758B0F0E, 0xEC110F0C, 0x76DD0504, 0xEF470506, 0xEEEC0003, 0x77760001
        };

        readonly UInt32[] Crc32_Poly814141AB_Table32 = new UInt32[256]
        {
        0x00000000, 0x814141AB, 0x83C3C2FD, 0x02828356, 0x86C6C451, 0x078785FA, 0x050506AC, 0x84444707,
        0x8CCCC909, 0x0D8D88A2, 0x0F0F0BF4, 0x8E4E4A5F, 0x0A0A0D58, 0x8B4B4CF3, 0x89C9CFA5, 0x08888E0E,
        0x98D8D3B9, 0x19999212, 0x1B1B1144, 0x9A5A50EF, 0x1E1E17E8, 0x9F5F5643, 0x9DDDD515, 0x1C9C94BE,
        0x14141AB0, 0x95555B1B, 0x97D7D84D, 0x169699E6, 0x92D2DEE1, 0x13939F4A, 0x11111C1C, 0x90505DB7,
        0xB0F0E6D9, 0x31B1A772, 0x33332424, 0xB272658F, 0x36362288, 0xB7776323, 0xB5F5E075, 0x34B4A1DE,
        0x3C3C2FD0, 0xBD7D6E7B, 0xBFFFED2D, 0x3EBEAC86, 0xBAFAEB81, 0x3BBBAA2A, 0x3939297C, 0xB87868D7,
        0x28283560, 0xA96974CB, 0xABEBF79D, 0x2AAAB636, 0xAEEEF131, 0x2FAFB09A, 0x2D2D33CC, 0xAC6C7267,
        0xA4E4FC69, 0x25A5BDC2, 0x27273E94, 0xA6667F3F, 0x22223838, 0xA3637993, 0xA1E1FAC5, 0x20A0BB6E,
        0xE0A08C19, 0x61E1CDB2, 0x63634EE4, 0xE2220F4F, 0x66664848, 0xE72709E3, 0xE5A58AB5, 0x64E4CB1E,
        0x6C6C4510, 0xED2D04BB, 0xEFAF87ED, 0x6EEEC646, 0xEAAA8141, 0x6BEBC0EA, 0x696943BC, 0xE8280217,
        0x78785FA0, 0xF9391E0B, 0xFBBB9D5D, 0x7AFADCF6, 0xFEBE9BF1, 0x7FFFDA5A, 0x7D7D590C, 0xFC3C18A7,
        0xF4B496A9, 0x75F5D702, 0x77775454, 0xF63615FF, 0x727252F8, 0xF3331353, 0xF1B19005, 0x70F0D1AE,
        0x50506AC0, 0xD1112B6B, 0xD393A83D, 0x52D2E996, 0xD696AE91, 0x57D7EF3A, 0x55556C6C, 0xD4142DC7,
        0xDC9CA3C9, 0x5DDDE262, 0x5F5F6134, 0xDE1E209F, 0x5A5A6798, 0xDB1B2633, 0xD999A565, 0x58D8E4CE,
        0xC888B979, 0x49C9F8D2, 0x4B4B7B84, 0xCA0A3A2F, 0x4E4E7D28, 0xCF0F3C83, 0xCD8DBFD5, 0x4CCCFE7E,
        0x44447070, 0xC50531DB, 0xC787B28D, 0x46C6F326, 0xC282B421, 0x43C3F58A, 0x414176DC, 0xC0003777,
        0x40005999, 0xC1411832, 0xC3C39B64, 0x4282DACF, 0xC6C69DC8, 0x4787DC63, 0x45055F35, 0xC4441E9E,
        0xCCCC9090, 0x4D8DD13B, 0x4F0F526D, 0xCE4E13C6, 0x4A0A54C1, 0xCB4B156A, 0xC9C9963C, 0x4888D797,
        0xD8D88A20, 0x5999CB8B, 0x5B1B48DD, 0xDA5A0976, 0x5E1E4E71, 0xDF5F0FDA, 0xDDDD8C8C, 0x5C9CCD27,
        0x54144329, 0xD5550282, 0xD7D781D4, 0x5696C07F, 0xD2D28778, 0x5393C6D3, 0x51114585, 0xD050042E,
        0xF0F0BF40, 0x71B1FEEB, 0x73337DBD, 0xF2723C16, 0x76367B11, 0xF7773ABA, 0xF5F5B9EC, 0x74B4F847,
        0x7C3C7649, 0xFD7D37E2, 0xFFFFB4B4, 0x7EBEF51F, 0xFAFAB218, 0x7BBBF3B3, 0x793970E5, 0xF878314E,
        0x68286CF9, 0xE9692D52, 0xEBEBAE04, 0x6AAAEFAF, 0xEEEEA8A8, 0x6FAFE903, 0x6D2D6A55, 0xEC6C2BFE,
        0xE4E4A5F0, 0x65A5E45B, 0x6727670D, 0xE66626A6, 0x622261A1, 0xE363200A, 0xE1E1A35C, 0x60A0E2F7,
        0xA0A0D580, 0x21E1942B, 0x2363177D, 0xA22256D6, 0x266611D1, 0xA727507A, 0xA5A5D32C, 0x24E49287,
        0x2C6C1C89, 0xAD2D5D22, 0xAFAFDE74, 0x2EEE9FDF, 0xAAAAD8D8, 0x2BEB9973, 0x29691A25, 0xA8285B8E,
        0x38780639, 0xB9394792, 0xBBBBC4C4, 0x3AFA856F, 0xBEBEC268, 0x3FFF83C3, 0x3D7D0095, 0xBC3C413E,
        0xB4B4CF30, 0x35F58E9B, 0x37770DCD, 0xB6364C66, 0x32720B61, 0xB3334ACA, 0xB1B1C99C, 0x30F08837,
        0x10503359, 0x911172F2, 0x9393F1A4, 0x12D2B00F, 0x9696F708, 0x17D7B6A3, 0x155535F5, 0x9414745E,
        0x9C9CFA50, 0x1DDDBBFB, 0x1F5F38AD, 0x9E1E7906, 0x1A5A3E01, 0x9B1B7FAA, 0x9999FCFC, 0x18D8BD57,
        0x8888E0E0, 0x09C9A14B, 0x0B4B221D, 0x8A0A63B6, 0x0E4E24B1, 0x8F0F651A, 0x8D8DE64C, 0x0CCCA7E7,
        0x044429E9, 0x85056842, 0x8787EB14, 0x06C6AABF, 0x8282EDB8, 0x03C3AC13, 0x01412F45, 0x80006EEE
        };

        readonly UInt32[] Crc32_Poly000000AF_Table32_Reflect = new UInt32[256]
        {
        0x00000000, 0x01EA0000, 0x03D40000, 0x023E0000, 0x07A80000, 0x06420000, 0x047C0000, 0x05960000,
        0x0F500000, 0x0EBA0000, 0x0C840000, 0x0D6E0000, 0x08F80000, 0x09120000, 0x0B2C0000, 0x0AC60000,
        0x1EA00000, 0x1F4A0000, 0x1D740000, 0x1C9E0000, 0x19080000, 0x18E20000, 0x1ADC0000, 0x1B360000,
        0x11F00000, 0x101A0000, 0x12240000, 0x13CE0000, 0x16580000, 0x17B20000, 0x158C0000, 0x14660000,
        0x3D400000, 0x3CAA0000, 0x3E940000, 0x3F7E0000, 0x3AE80000, 0x3B020000, 0x393C0000, 0x38D60000,
        0x32100000, 0x33FA0000, 0x31C40000, 0x302E0000, 0x35B80000, 0x34520000, 0x366C0000, 0x37860000,
        0x23E00000, 0x220A0000, 0x20340000, 0x21DE0000, 0x24480000, 0x25A20000, 0x279C0000, 0x26760000,
        0x2CB00000, 0x2D5A0000, 0x2F640000, 0x2E8E0000, 0x2B180000, 0x2AF20000, 0x28CC0000, 0x29260000,
        0x7A800000, 0x7B6A0000, 0x79540000, 0x78BE0000, 0x7D280000, 0x7CC20000, 0x7EFC0000, 0x7F160000,
        0x75D00000, 0x743A0000, 0x76040000, 0x77EE0000, 0x72780000, 0x73920000, 0x71AC0000, 0x70460000,
        0x64200000, 0x65CA0000, 0x67F40000, 0x661E0000, 0x63880000, 0x62620000, 0x605C0000, 0x61B60000,
        0x6B700000, 0x6A9A0000, 0x68A40000, 0x694E0000, 0x6CD80000, 0x6D320000, 0x6F0C0000, 0x6EE60000,
        0x47C00000, 0x462A0000, 0x44140000, 0x45FE0000, 0x40680000, 0x41820000, 0x43BC0000, 0x42560000,
        0x48900000, 0x497A0000, 0x4B440000, 0x4AAE0000, 0x4F380000, 0x4ED20000, 0x4CEC0000, 0x4D060000,
        0x59600000, 0x588A0000, 0x5AB40000, 0x5B5E0000, 0x5EC80000, 0x5F220000, 0x5D1C0000, 0x5CF60000,
        0x56300000, 0x57DA0000, 0x55E40000, 0x540E0000, 0x51980000, 0x50720000, 0x524C0000, 0x53A60000,
        0xF5000000, 0xF4EA0000, 0xF6D40000, 0xF73E0000, 0xF2A80000, 0xF3420000, 0xF17C0000, 0xF0960000,
        0xFA500000, 0xFBBA0000, 0xF9840000, 0xF86E0000, 0xFDF80000, 0xFC120000, 0xFE2C0000, 0xFFC60000,
        0xEBA00000, 0xEA4A0000, 0xE8740000, 0xE99E0000, 0xEC080000, 0xEDE20000, 0xEFDC0000, 0xEE360000,
        0xE4F00000, 0xE51A0000, 0xE7240000, 0xE6CE0000, 0xE3580000, 0xE2B20000, 0xE08C0000, 0xE1660000,
        0xC8400000, 0xC9AA0000, 0xCB940000, 0xCA7E0000, 0xCFE80000, 0xCE020000, 0xCC3C0000, 0xCDD60000,
        0xC7100000, 0xC6FA0000, 0xC4C40000, 0xC52E0000, 0xC0B80000, 0xC1520000, 0xC36C0000, 0xC2860000,
        0xD6E00000, 0xD70A0000, 0xD5340000, 0xD4DE0000, 0xD1480000, 0xD0A20000, 0xD29C0000, 0xD3760000,
        0xD9B00000, 0xD85A0000, 0xDA640000, 0xDB8E0000, 0xDE180000, 0xDFF20000, 0xDDCC0000, 0xDC260000,
        0x8F800000, 0x8E6A0000, 0x8C540000, 0x8DBE0000, 0x88280000, 0x89C20000, 0x8BFC0000, 0x8A160000,
        0x80D00000, 0x813A0000, 0x83040000, 0x82EE0000, 0x87780000, 0x86920000, 0x84AC0000, 0x85460000,
        0x91200000, 0x90CA0000, 0x92F40000, 0x931E0000, 0x96880000, 0x97620000, 0x955C0000, 0x94B60000,
        0x9E700000, 0x9F9A0000, 0x9DA40000, 0x9C4E0000, 0x99D80000, 0x98320000, 0x9A0C0000, 0x9BE60000,
        0xB2C00000, 0xB32A0000, 0xB1140000, 0xB0FE0000, 0xB5680000, 0xB4820000, 0xB6BC0000, 0xB7560000,
        0xBD900000, 0xBC7A0000, 0xBE440000, 0xBFAE0000, 0xBA380000, 0xBBD20000, 0xB9EC0000, 0xB8060000,
        0xAC600000, 0xAD8A0000, 0xAFB40000, 0xAE5E0000, 0xABC80000, 0xAA220000, 0xA81C0000, 0xA9F60000,
        0xA3300000, 0xA2DA0000, 0xA0E40000, 0xA10E0000, 0xA4980000, 0xA5720000, 0xA74C0000, 0xA6A60000
        };

        readonly UInt32[] Crc32_Poly000000AF_Table32 = new UInt32[256]
        {
        0x00000000, 0x000000AF, 0x0000015E, 0x000001F1, 0x000002BC, 0x00000213, 0x000003E2, 0x0000034D,
        0x00000578, 0x000005D7, 0x00000426, 0x00000489, 0x000007C4, 0x0000076B, 0x0000069A, 0x00000635,
        0x00000AF0, 0x00000A5F, 0x00000BAE, 0x00000B01, 0x0000084C, 0x000008E3, 0x00000912, 0x000009BD,
        0x00000F88, 0x00000F27, 0x00000ED6, 0x00000E79, 0x00000D34, 0x00000D9B, 0x00000C6A, 0x00000CC5,
        0x000015E0, 0x0000154F, 0x000014BE, 0x00001411, 0x0000175C, 0x000017F3, 0x00001602, 0x000016AD,
        0x00001098, 0x00001037, 0x000011C6, 0x00001169, 0x00001224, 0x0000128B, 0x0000137A, 0x000013D5,
        0x00001F10, 0x00001FBF, 0x00001E4E, 0x00001EE1, 0x00001DAC, 0x00001D03, 0x00001CF2, 0x00001C5D,
        0x00001A68, 0x00001AC7, 0x00001B36, 0x00001B99, 0x000018D4, 0x0000187B, 0x0000198A, 0x00001925,
        0x00002BC0, 0x00002B6F, 0x00002A9E, 0x00002A31, 0x0000297C, 0x000029D3, 0x00002822, 0x0000288D,
        0x00002EB8, 0x00002E17, 0x00002FE6, 0x00002F49, 0x00002C04, 0x00002CAB, 0x00002D5A, 0x00002DF5,
        0x00002130, 0x0000219F, 0x0000206E, 0x000020C1, 0x0000238C, 0x00002323, 0x000022D2, 0x0000227D,
        0x00002448, 0x000024E7, 0x00002516, 0x000025B9, 0x000026F4, 0x0000265B, 0x000027AA, 0x00002705,
        0x00003E20, 0x00003E8F, 0x00003F7E, 0x00003FD1, 0x00003C9C, 0x00003C33, 0x00003DC2, 0x00003D6D,
        0x00003B58, 0x00003BF7, 0x00003A06, 0x00003AA9, 0x000039E4, 0x0000394B, 0x000038BA, 0x00003815,
        0x000034D0, 0x0000347F, 0x0000358E, 0x00003521, 0x0000366C, 0x000036C3, 0x00003732, 0x0000379D,
        0x000031A8, 0x00003107, 0x000030F6, 0x00003059, 0x00003314, 0x000033BB, 0x0000324A, 0x000032E5,
        0x00005780, 0x0000572F, 0x000056DE, 0x00005671, 0x0000553C, 0x00005593, 0x00005462, 0x000054CD,
        0x000052F8, 0x00005257, 0x000053A6, 0x00005309, 0x00005044, 0x000050EB, 0x0000511A, 0x000051B5,
        0x00005D70, 0x00005DDF, 0x00005C2E, 0x00005C81, 0x00005FCC, 0x00005F63, 0x00005E92, 0x00005E3D,
        0x00005808, 0x000058A7, 0x00005956, 0x000059F9, 0x00005AB4, 0x00005A1B, 0x00005BEA, 0x00005B45,
        0x00004260, 0x000042CF, 0x0000433E, 0x00004391, 0x000040DC, 0x00004073, 0x00004182, 0x0000412D,
        0x00004718, 0x000047B7, 0x00004646, 0x000046E9, 0x000045A4, 0x0000450B, 0x000044FA, 0x00004455,
        0x00004890, 0x0000483F, 0x000049CE, 0x00004961, 0x00004A2C, 0x00004A83, 0x00004B72, 0x00004BDD,
        0x00004DE8, 0x00004D47, 0x00004CB6, 0x00004C19, 0x00004F54, 0x00004FFB, 0x00004E0A, 0x00004EA5,
        0x00007C40, 0x00007CEF, 0x00007D1E, 0x00007DB1, 0x00007EFC, 0x00007E53, 0x00007FA2, 0x00007F0D,
        0x00007938, 0x00007997, 0x00007866, 0x000078C9, 0x00007B84, 0x00007B2B, 0x00007ADA, 0x00007A75,
        0x000076B0, 0x0000761F, 0x000077EE, 0x00007741, 0x0000740C, 0x000074A3, 0x00007552, 0x000075FD,
        0x000073C8, 0x00007367, 0x00007296, 0x00007239, 0x00007174, 0x000071DB, 0x0000702A, 0x00007085,
        0x000069A0, 0x0000690F, 0x000068FE, 0x00006851, 0x00006B1C, 0x00006BB3, 0x00006A42, 0x00006AED,
        0x00006CD8, 0x00006C77, 0x00006D86, 0x00006D29, 0x00006E64, 0x00006ECB, 0x00006F3A, 0x00006F95,
        0x00006350, 0x000063FF, 0x0000620E, 0x000062A1, 0x000061EC, 0x00006143, 0x000060B2, 0x0000601D,
        0x00006628, 0x00006687, 0x00006776, 0x000067D9, 0x00006494, 0x0000643B, 0x000065CA, 0x00006565
        };
        #endregion 

        public UInt32 CRC32_Calculate(Scm_CRC32_InputParameters scm_CRC32_InputParameters)
        {
            UInt32 poly = scm_CRC32_InputParameters.Polynomial;
            UInt32 crc = scm_CRC32_InputParameters.InitCrc;
            int width = scm_CRC32_InputParameters.cWidth;

            //小端模式,反转多项式
            if (scm_CRC32_InputParameters.LittleEndian)
                poly = SpecialFunctions.ReverseBits.ReverseUInt32(poly);

            for (int i = 0; i < scm_CRC32_InputParameters.Datas.Length; i++)
            {
                byte tempData = scm_CRC32_InputParameters.Datas[i];
                //输入反转
                if (scm_CRC32_InputParameters.RefIn)
                    tempData = SpecialFunctions.ReverseBits.ReverseUInt8(tempData);

                if (scm_CRC32_InputParameters.LittleEndian)
                    crc ^= (UInt32)(tempData & 0xff);
                else
                    //左移到最高字节,然后与初始值异或
                    crc ^= (UInt32)(tempData << (width - 8));


                for (int j = 0; j < 8; j++)
                {
                    if (scm_CRC32_InputParameters.LittleEndian)
                    {//小端模式
                        //最低位为1,异或多项式
                        if ((crc & 0x01) != 0)
                        {
                            crc >>= 1;
                            crc ^= poly;
                        }
                        else
                            crc >>= 1;

                    }
                    else
                    {
                        //最高位为1,异或多项式
                        if ((crc & ((UInt32)1 << (width - 1))) != 0)
                        {
                            crc <<= 1;
                            crc ^= poly;
                        }
                        else
                            crc <<= 1;
                    }
                }

            }

            //输出反转
            if (scm_CRC32_InputParameters.RefOut)
                crc = SpecialFunctions.ReverseBits.ReverseUInt32(crc);

            //输出异或
            //if (scm_CRC32_InputParameters.isOutputXor)
            crc ^= scm_CRC32_InputParameters.XorOut;

            return crc;

        }

        public UInt32[] GetCRC32_ByteTable(UInt32 poly, bool LittleEndian)
        {
            Scm_CRC32_InputParameters scm_CRC32_InputParameters = new Scm_CRC32_InputParameters()
            { LittleEndian = LittleEndian, Polynomial = poly, InitCrc = 0x00000000, RefIn = false, RefOut = false, XorOut = 0x00000000 };

            UInt32[] table = new UInt32[256];
            for (int i = 0; i < 256; i++)
            {
                scm_CRC32_InputParameters.Datas = new byte[1] { (byte)i };
                table[i] = CRC32_Calculate(scm_CRC32_InputParameters);
            }
            return table;
        }

        /// 
        /// CRC32
        /// 字节查表法
        /// 
        UInt32 CRC32_CalCrcByByte(Scm_CRC32_InputParameters scm_CRC32_InputParameters)
        {


            UInt32 poly = scm_CRC32_InputParameters.Polynomial;
            UInt32 crc = scm_CRC32_InputParameters.InitCrc;
            int width = scm_CRC32_InputParameters.cWidth;

            //小端模式,反转多项式
            if (scm_CRC32_InputParameters.LittleEndian)
                poly = SpecialFunctions.ReverseBits.ReverseUInt32(poly);

            for (int i = 0; i < scm_CRC32_InputParameters.Datas.Length; i++)
            {
                byte tempData = scm_CRC32_InputParameters.Datas[i];
                //输入反转
                if (scm_CRC32_InputParameters.RefIn)
                    tempData = SpecialFunctions.ReverseBits.ReverseUInt8(tempData);

                byte index = 0;
                //异或的部分最终会消除掉,这里我们就不将其存到CRC了
                if (scm_CRC32_InputParameters.LittleEndian)
                    //最低字节与初始值异或
                    index = (byte)(crc ^ tempData);
                else
                    //左移到最高字节,然后与初始值异或
                    index = (byte)((crc >> (width - 8)) ^ tempData);


                switch (poly)
                {
                    case 0x04C11DB7:
                        if (scm_CRC32_InputParameters.LittleEndian)
                            crc = (UInt32)((crc>>8) ^ Crc32_Poly04C11DB7_Table32_Reflect[index]);
                        else
                            crc = (UInt32)((crc << 8) ^ Crc32_Poly04C11DB7_Table32[index]);
                        break;

                    case 0x1EDC6F41:
                        if (scm_CRC32_InputParameters.LittleEndian)
                            crc = (UInt32)((crc >> 8) ^ Crc32_Poly1EDC6F41_Table32_Reflect[index]);
                        else
                            crc = (UInt32)((crc << 8) ^ Crc32_Poly1EDC6F41_Table32[index]);
                        break;

                    case 0xA833982B:
                        if (scm_CRC32_InputParameters.LittleEndian)
                            crc = (UInt32)((crc >> 8) ^ Crc32_PolyA833982B_Table32_Reflect[index]);
                        else
                            crc = (UInt32)((crc << 8) ^ Crc32_PolyA833982B_Table32[index]);
                        break;

                    case 0x814141AB:
                        if (scm_CRC32_InputParameters.LittleEndian)
                            crc = (UInt32)((crc >> 8) ^ Crc32_Poly814141AB_Table32_Reflect[index]);
                        else
                            crc = (UInt32)((crc << 8) ^ Crc32_Poly814141AB_Table32[index]);
                        break;

                    case 0x000000AF:
                        if (scm_CRC32_InputParameters.LittleEndian)
                            crc = (UInt32)((crc >> 8) ^ Crc32_Poly000000AF_Table32_Reflect[index]);
                        else
                            crc = (UInt32)((crc << 8) ^ Crc32_Poly000000AF_Table32[index]);
                        break;

                    default:

                        crc = 0;
                        break;
                }

            }

            //输出反转
            if (scm_CRC32_InputParameters.RefOut)
                crc = SpecialFunctions.ReverseBits.ReverseUInt32(crc);

            //输出异或
            //if (scm_CRC32_InputParameters.isOutputXor)
            crc ^= scm_CRC32_InputParameters.XorOut;

            return crc;

        }

        private void CalCrc32All(byte[] data)
        {
            //计算网页地址:https://crccalc.com/
            //网址2:https://emn178.github.io/online-tools/crc32.html
            //http://www.sunshine2k.de/coding/javascript/crc/crc_js.html

            Scm_CRC32_InputParameters[] scm_CRC32_InputParametersList = new Scm_CRC32_InputParameters[] {
                new Scm_CRC32_InputParameters(){ AlgorithmName ="CRC-32       ", Polynomial=0x04C11DB7, InitCrc=0xFFFFFFFF, RefIn=true,  RefOut=true,  XorOut=0xFFFFFFFF, Datas=SpecialFunctions.ArrayCopy.CopyArray(data)},
                new Scm_CRC32_InputParameters(){ AlgorithmName ="CRC-32/BZIP2 ", Polynomial=0x04C11DB7, InitCrc=0xFFFFFFFF, RefIn=false, RefOut=false, XorOut=0xFFFFFFFF, Datas=SpecialFunctions.ArrayCopy.CopyArray(data)},
                new Scm_CRC32_InputParameters(){ AlgorithmName ="CRC-32C      ", Polynomial=0x1EDC6F41, InitCrc=0xFFFFFFFF, RefIn=true,  RefOut=true,  XorOut=0xFFFFFFFF, Datas=SpecialFunctions.ArrayCopy.CopyArray(data)},
                new Scm_CRC32_InputParameters(){ AlgorithmName ="CRC-32D      ", Polynomial=0xA833982B, InitCrc=0xFFFFFFFF, RefIn=true,  RefOut=true,  XorOut=0xFFFFFFFF, Datas=SpecialFunctions.ArrayCopy.CopyArray(data)},
                new Scm_CRC32_InputParameters(){ AlgorithmName ="CRC-32/MPEG-2", Polynomial=0x04C11DB7, InitCrc=0xFFFFFFFF, RefIn=false, RefOut=false, XorOut=0x00000000, Datas=SpecialFunctions.ArrayCopy.CopyArray(data)},
                new Scm_CRC32_InputParameters(){ AlgorithmName ="CRC-32/POSIX ", Polynomial=0x04C11DB7, InitCrc=0x00000000, RefIn=false, RefOut=false, XorOut=0xFFFFFFFF, Datas=SpecialFunctions.ArrayCopy.CopyArray(data)},
                new Scm_CRC32_InputParameters(){ AlgorithmName ="CRC-32Q      ", Polynomial=0x814141AB, InitCrc=0x00000000, RefIn=false, RefOut=false, XorOut=0x00000000, Datas=SpecialFunctions.ArrayCopy.CopyArray(data)},
                new Scm_CRC32_InputParameters(){ AlgorithmName ="CRC-32/JAMCRC", Polynomial=0x04C11DB7, InitCrc=0xFFFFFFFF, RefIn=true,  RefOut=true,  XorOut=0x00000000, Datas=SpecialFunctions.ArrayCopy.CopyArray(data)},
                new Scm_CRC32_InputParameters(){ AlgorithmName ="CRC-32/XFER  ", Polynomial=0x000000AF, InitCrc=0x00000000, RefIn=false, RefOut=false, XorOut=0x00000000, Datas=SpecialFunctions.ArrayCopy.CopyArray(data)},

            };

            for (int i = 0; i < scm_CRC32_InputParametersList.Length; i++)
            {
                //scm_CRC32_InputParametersList[i].Datas = SpecialFunctions.ArrayCopy.CopyArray(data);
                UInt32 crc1 = CRC32_Calculate(scm_CRC32_InputParametersList[i]);

                Console.WriteLine("BitsCal {0}, Poly={1:X08}, InitCrc={2:X08}, RefIn={3}, RefOut={4}, XorOut={5:X08}, data={6}, result={7:X08}",
                    scm_CRC32_InputParametersList[i].AlgorithmName,
                    scm_CRC32_InputParametersList[i].Polynomial, scm_CRC32_InputParametersList[i].InitCrc,
                    (scm_CRC32_InputParametersList[i].RefIn ? "True " : "False"), (scm_CRC32_InputParametersList[i].RefOut ? "True " : "False"),
                    scm_CRC32_InputParametersList[i].XorOut, BitConverter.ToString(scm_CRC32_InputParametersList[i].Datas).Replace("-", ""),
                    crc1);

                UInt32 crc2 = CRC32_CalCrcByByte(scm_CRC32_InputParametersList[i]);

                Console.WriteLine("ByteCal {0}, Poly={1:X08}, InitCrc={2:X08}, RefIn={3}, RefOut={4}, XorOut={5:X08}, data={6}, result={7:X08}",
                    scm_CRC32_InputParametersList[i].AlgorithmName,
                    scm_CRC32_InputParametersList[i].Polynomial, scm_CRC32_InputParametersList[i].InitCrc,
                    (scm_CRC32_InputParametersList[i].RefIn ? "True " : "False"), (scm_CRC32_InputParametersList[i].RefOut ? "True " : "False"),
                    scm_CRC32_InputParametersList[i].XorOut, BitConverter.ToString(scm_CRC32_InputParametersList[i].Datas).Replace("-", ""),
                    crc2);

                if (crc1 != crc2)
                {
                    ConsoleColor temp = Console.ForegroundColor;
                    Console.ForegroundColor = ConsoleColor.Red;
                    Console.WriteLine("Not Same");
                    Console.ForegroundColor = temp;
                }
            }
        }

        private void GetTableTest()
        {
            UInt32[] polyList = new UInt32[] { 0x04C11DB7, 0x1EDC6F41, 0xA833982B, 0x814141AB, 0x000000AF };

            for (int pp = 0; pp < polyList.Length; pp++)
            {
                bool[] littleEndian = new bool[] { true, false };

                for (int ss = 0; ss < littleEndian.Length; ss++)
                {
                    Console.Write("readonly UInt32[] Crc32_Poly" + polyList[pp].ToString("X8") + "_Table32" + (littleEndian[ss] ? "_Reflect" : "") + " = new UInt32[256]\r\n{");
                    UInt32[] table = GetCRC32_ByteTable(polyList[pp], littleEndian[ss]);
                    //UInt32[] table = GetCRC32_ByteTable_1((uint)(polyList[pp] + (1 << 16)));
                    for (int i = 0; i < table.Length; i++)
                    {
                        if (i % 8 == 0)
                        {
                            Console.WriteLine();
                            Console.Write("\t");
                        }


                        if (i < table.Length - 1)
                            Console.Write("0x{0:X08}, ", table[i]);
                        else
                        {
                            Console.Write("0x{0:X08}\r\n", table[i]);
                            Console.WriteLine(@"};");
                            Console.WriteLine();
                        }


                    }
                }
            }
            Console.WriteLine();

        }



        public static void Test(byte[] data, UInt32 crcInitial)
        {
            CRC32 cRC32 = new CRC32();

            cRC32.CalCrc32All(data);
            //cRC32.GetTableTest();

        }

    }
}

 

 

上一篇 【CRC】CRC推导(六)CRC16的各种实现    下一篇 【CRC】CRC推导(八)CRC64的各种实现

你可能感兴趣的:(算法,CRC,CRC32)