view dcrypt/misc/Checksum.d @ 28:ad687db713a4

Further reworked the code for hash padding. Replaced all instances of 'char[]' with 'string' and removed a few 'const' modifiers as per Glenn Haecker's patch for D2 compatibility. Updated CONTRIBUTORS file.
author Thomas Dixon <reikon@reikon.us>
date Sun, 10 May 2009 22:38:48 -0400
parents 5ce3012f1def
children 21847420b1ac
line wrap: on
line source

/**
 * This file is part of the dcrypt project.
 *
 * Copyright: Copyright (C) dcrypt contributors 2008. All rights reserved.
 * License:   MIT
 * Authors:   Thomas Dixon
 */

module dcrypt.misc.Checksum;

/** Base class for 32-bit checksums */
abstract class Checksum {
    /**
     * Compute a checksum.
     * 
     * Params:
     *     input_ = Data to be processed.
     *     start = Starting value for the checksum.
     *     
     * Returns: The computed 32 bit checksum.
     */
    uint compute(void[] input_, uint start);
    
    /** Returns: The name of the checksum algorithm. */
    string name();
}