Skip to content
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

CRC-32 #191

Merged
merged 6 commits into from
Dec 24, 2019
Merged

CRC-32 #191

merged 6 commits into from
Dec 24, 2019

Conversation

vyazelenko
Copy link
Contributor

This PR adds CrcUtil class that allows computing CRC-32 checksum from a direct ByteBuffer's content without modifying any of the ByteBuffer state.

import java.lang.reflect.Method;
import java.util.zip.CRC32;

public final class CrcUtil
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better name may be Checksums.

manifest.attributes('Main-Class': 'org.openjdk.jmh.Main')
}

uploadArchives {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't publish benchmarks.

* @param length of the data from which CRC-32 checksum should be computed.
* @return CRC-32 checksum.
*/
public static int crc32DirectByteBuffer(final int crc, final long address, final int offset, final int length)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

crc32 is sufficient as a name. The address does not need to be for a direct ByteBuffer.

@mjpt777 mjpt777 merged commit 1554fd6 into master Dec 24, 2019
@vyazelenko vyazelenko deleted the crc32 branch December 24, 2019 16:08
mjpt777 added a commit that referenced this pull request Dec 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants