/*
 * Copyright (c) 2004-2017, by Alex Leigh.
 * All rights reserved.
 *
 * THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE
 * The copyright notice above does not evidence any
 * actual or intended publication of such source code.
 */

package lc.mecha.cksum;

import java.nio.ByteBuffer;

/**
 * Standard interface for checksum providers.
 *
 * @author Alex Leigh
 */
public interface Checksum {
    /**
     * Returns the size in bytes of the checksum.
     *
     * @return
     */
    int getSize();

    void update(byte[] data);

    void writeChecksumValue(ByteBuffer data);

    /**
     * Return a newly allocated byte array containing the value of the checksum.
     *
     * @return
     */
    ByteBuffer getChecksumValue();

    void reset();

}
