Reimplemented crc32 based on PHP implementation