-
Notifications
You must be signed in to change notification settings - Fork 607
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create fs2.compression.checksum
#2606
Conversation
Note this is built in to scodec-bits: http://scodec.org/api/scodec-bits/1.1.0/scodec/bits/crc$.html |
Oops! Lets see where that gets us. |
Does the scodec-bits implementation support streaming? If so, it's not obvious to me how it can be used here. |
Ahh, it's a linear function. So actually, we don't need any of this, do we? |
Reopening, now that I've done my homework. CRC32's can be combined due to their linearity, but implementing this is fairly involved and would not be as performant. See this in zlib. Interestingly, the CRC32 implementation I've ported here was mentioned in scodec/scodec-bits@d69a425#r18797902. Thoughts? |
Couple thoughts:
|
Makes sense, thanks. Fix (1) in scodec-bits, everything becomes easier here and we should get (2) for free :) Now if I can muster up the courage to poke at that code 😅 |
Updated to use the new builder from scodec/scodec-bits#316. I followed the style of |
Checksum[F]
and implement CRC32 checksumfs2.compression.checksum
Creates a new
fs.compression.Checksum[F]
trait which so far provides theCRC32
algorithm. This is used for example in http4s compression middleware.The JVM implementation uses
java.util.zip.CRC32
. The JS implementation is kindly provided by means of Kafka. It's worth noting that they reimplemented CRC32 in Java for performance reasons, and since we've already ported the code here we may as well consider using it on the JVM as well.