#1 2019-02-22 08:42:15

keinn
Member
Registered: 2014-10-20
Posts: 103

Synopse Crc32 checksum result different from other language

for example ,
hex:=SynCommons.crc32cUTF8ToHex('1');

here the result is '90F599E3'

it is diff from the widely used online service
https://www.lammertbies.nl/comm/info/cr … ation.html
and other online calculation services

it should be '83DCEFB7'

Offline

#2 2019-02-22 09:14:46

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,660
Website

Re: Synopse Crc32 checksum result different from other language

Because it is crc32c not crc32 as used in deflate/zip.

See what the documentation and comment says: "result is not compatible with zlib's crc32() - not the same polynom".

The main point of crc32c is that it is hardware accelerated on SSE4.2 processors, so we usually achieve 16MB/s on x86_64 with our Intel-optimized version - much faster than any other alternative.
It is Intel's fault if they integrated crc32c polynom, and not crc32 polynom - not ours. wink

Use crc32() from SynZip if you want the deflate/zip value.
It will be slower, but compatible.

I tried to make the documentation more explicit about this https://synopse.info/fossil/info/282d870af7

Offline

#3 2019-02-22 13:19:55

keinn
Member
Registered: 2014-10-20
Posts: 103

Re: Synopse Crc32 checksum result different from other language

Yes~~i just find about SynZip.pas ~
thank you for the lovely and also fastest reply ~

Offline

Board footer

Powered by FluxBB