view dcrypt/misc/Checksum.d @ 30:21847420b1ac

Changed Hash's update method to a more optimized variant. Changed the code style for the entire misc package (completely forgot about it). Further changes for D2 compatibility. It appears as if full compatibility won't be possibledue to D2's handling of void[], but the number of changes to obtain compatibility can be minimized in the least.
author Thomas Dixon <reikon@reikon.us>
date Mon, 11 May 2009 15:32:00 -0400
parents ad687db713a4
children 2b4bccdc8387
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();
}