DEFLNG CRC32_Table(0 TO 255) = { _
&H00000000,&H77073096,&Hee0e612c,&H990951ba,&H076dc419,&H706af48f,&He963a535, _
&H9e6495a3,&H0edb8832,&H79dcb8a4,&He0d5e91e,&H97d2d988,&H09b64c2b,&H7eb17cbd, _
&He7b82d07,&H90bf1d91,&H1db71064,&H6ab020f2,&Hf3b97148,&H84be41de,&H1adad47d, _
&H6ddde4eb,&Hf4d4b551,&H83d385c7,&H136c9856,&H646ba8c0,&Hfd62f97a,&H8a65c9ec, _
&H14015c4f,&H63066cd9,&Hfa0f3d63,&H8d080df5,&H3b6e20c8,&H4c69105e,&Hd56041e4, _
&Ha2677172,&H3c03e4d1,&H4b04d447,&Hd20d85fd,&Ha50ab56b,&H35b5a8fa,&H42b2986c, _
&Hdbbbc9d6,&Hacbcf940,&H32d86ce3,&H45df5c75,&Hdcd60dcf,&Habd13d59,&H26d930ac, _
&H51de003a,&Hc8d75180,&Hbfd06116,&H21b4f4b5,&H56b3c423,&Hcfba9599,&Hb8bda50f, _
&H2802b89e,&H5f058808,&Hc60cd9b2,&Hb10be924,&H2f6f7c87,&H58684c11,&Hc1611dab, _
&Hb6662d3d,&H76dc4190,&H01db7106,&H98d220bc,&Hefd5102a,&H71b18589,&H06b6b51f, _
&H9fbfe4a5,&He8b8d433,&H7807c9a2,&H0f00f934,&H9609a88e,&He10e9818,&H7f6a0dbb, _
&H086d3d2d,&H91646c97,&He6635c01,&H6b6b51f4,&H1c6c6162,&H856530d8,&Hf262004e, _
&H6c0695ed,&H1b01a57b,&H8208f4c1,&Hf50fc457,&H65b0d9c6,&H12b7e950,&H8bbeb8ea, _
&Hfcb9887c,&H62dd1ddf,&H15da2d49,&H8cd37cf3,&Hfbd44c65,&H4db26158,&H3ab551ce, _
&Ha3bc0074,&Hd4bb30e2,&H4adfa541,&H3dd895d7,&Ha4d1c46d,&Hd3d6f4fb,&H4369e96a, _
&H346ed9fc,&Had678846,&Hda60b8d0,&H44042d73,&H33031de5,&Haa0a4c5f,&Hdd0d7cc9, _
&H5005713c,&H270241aa,&Hbe0b1010,&Hc90c2086,&H5768b525,&H206f85b3,&Hb966d409, _
&Hce61e49f,&H5edef90e,&H29d9c998,&Hb0d09822,&Hc7d7a8b4,&H59b33d17,&H2eb40d81, _
&Hb7bd5c3b,&Hc0ba6cad,&Hedb88320,&H9abfb3b6,&H03b6e20c,&H74b1d29a,&Head54739, _
&H9dd277af,&H04db2615,&H73dc1683,&He3630b12,&H94643b84,&H0d6d6a3e,&H7a6a5aa8, _
&He40ecf0b,&H9309ff9d,&H0a00ae27,&H7d079eb1,&Hf00f9344,&H8708a3d2,&H1e01f268, _
&H6906c2fe,&Hf762575d,&H806567cb,&H196c3671,&H6e6b06e7,&Hfed41b76,&H89d32be0, _
&H10da7a5a,&H67dd4acc,&Hf9b9df6f,&H8ebeeff9,&H17b7be43,&H60b08ed5,&Hd6d6a3e8, _
&Ha1d1937e,&H38d8c2c4,&H4fdff252,&Hd1bb67f1,&Ha6bc5767,&H3fb506dd,&H48b2364b, _
&Hd80d2bda,&Haf0a1b4c,&H36034af6,&H41047a60,&Hdf60efc3,&Ha867df55,&H316e8eef, _
&H4669be79,&Hcb61b38c,&Hbc66831a,&H256fd2a0,&H5268e236,&Hcc0c7795,&Hbb0b4703, _
&H220216b9,&H5505262f,&Hc5ba3bbe,&Hb2bd0b28,&H2bb45a92,&H5cb36a04,&Hc2d7ffa7, _
&Hb5d0cf31,&H2cd99e8b,&H5bdeae1d,&H9b64c2b0,&Hec63f226,&H756aa39c,&H026d930a, _
&H9c0906a9,&Heb0e363f,&H72076785,&H05005713,&H95bf4a82,&He2b87a14,&H7bb12bae, _
&H0cb61b38,&H92d28e9b,&He5d5be0d,&H7cdcefb7,&H0bdbdf21,&H86d3d2d4,&Hf1d4e242, _
&H68ddb3f8,&H1fda836e,&H81be16cd,&Hf6b9265b,&H6fb077e1,&H18b74777,&H88085ae6, _
&Hff0f6a70,&H66063bca,&H11010b5c,&H8f659eff,&Hf862ae69,&H616bffd3,&H166ccf45, _
&Ha00ae278,&Hd70dd2ee,&H4e048354,&H3903b3c2,&Ha7672661,&Hd06016f7,&H4969474d, _
&H3e6e77db,&Haed16a4a,&Hd9d65adc,&H40df0b66,&H37d83bf0,&Ha9bcae53,&Hdebb9ec5, _
&H47b2cf7f,&H30b5ffe9,&Hbdbdf21c,&Hcabac28a,&H53b39330,&H24b4a3a6,&Hbad03605, _
&Hcdd70693,&H54de5729,&H23d967bf,&Hb3667a2e,&Hc4614ab8,&H5d681b02,&H2a6f2b94, _
&Hb40bbe37,&Hc30c8ea1,&H5a05df1b,&H2d02ef8d }
$RESOURCE CRC32_BinProcFile AS "crc32.bin"
DIM CRC32_BinProc AS QMEMORYSTREAM
CRC32_BinProc.ExtractRes(RESOURCE(CRC32_BinProcFile))
DECLARE FUNCTION CallBinProc LIB "user32" ALIAS "CallWindowProcA" _
(Proc AS LONG, A1 AS LONG, A2 AS LONG, A3 AS LONG, A4 AS LONG) AS LONG
FUNCTION CRC32(Buffer AS LONG, Size AS LONG) AS LONG
Result = CallBinProc(CRC32_BinProc.Pointer, Buffer, Size, VARPTR(CRC32_Table(0)), 0)
END FUNCTION
FUNCTION STRCRC32(BYREF s AS STRING) AS LONG
DEFSTR tmp = s
Result = CRC32(VARPTR(tmp), LEN(tmp))
END FUNCTION
|
|