add helper method to generate same crc32 results as php and boost::crc_32_type
authorBenjamin Renard <benj@fb.com>
Tue, 11 Jul 2017 22:54:24 +0000 (15:54 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Tue, 11 Jul 2017 23:07:14 +0000 (16:07 -0700)
commit13feee4bceed50023f6e6ba88b0f492dd3b4caf7
tree17a09b3956e6a5d55291c6b35ee359ec334b49d2
parent4169222e2f6da6ab300df01df71a46e6a1c38eac
add helper method to generate same crc32 results as php and boost::crc_32_type

Summary:
This revision adds a helper method in folly/Checksum.h, that returns the same crc32 value as php's built-in implementationa and boost::crc_32_type.

folly's default implementation only differs from the final xor (with 0xFFFFFFFF for boost and php, 0 for folly), which is added here.

Reviewed By: djwatson

Differential Revision: D5396671

fbshipit-source-id: 14874af2d5a80408c772875142de6e340ce01038
folly/Checksum.cpp
folly/Checksum.h
folly/test/ChecksumTest.cpp