All Downloads are FREE. Search and download functionalities are using the official Maven repository.

htsjdk.samtools.cram.digest.MessageDigestHasher Maven / Gradle / Ivy

There is a newer version: 4.1.3
Show newest version
package htsjdk.samtools.cram.digest;

import java.security.MessageDigest;

class MessageDigestHasher extends AbstractSerialDigest {
    private final MessageDigest messageDigest;

    MessageDigestHasher(final MessageDigest messageDigest, final Combine combine,
                        final byte[] value) {
        super(combine, value);
        this.messageDigest = messageDigest;
    }

    @Override
    protected void resetAndUpdate(final byte[] data) {
        messageDigest.reset();
        messageDigest.update(data);
    }

    @Override
    protected byte[] getValue() {
        return messageDigest.digest();
    }

    @Override
    protected byte[] asByteArray() {
        return messageDigest.digest();
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy