00001 #ifndef UTILITY_GROUP 00002 #define UTILITY_GROUP 00003 00004 /*****************************************************************************\ 00005 * * 00006 * Name : utility group * 00007 * Author : Chris Koeritz * 00008 * * 00009 ******************************************************************************* 00010 * Copyright (c) 1992-$now By Author. This program is free software; you can * 00011 * redistribute it and/or modify it under the terms of the GNU General Public * 00012 * License as published by the Free Software Foundation; either version 2 of * 00013 * the License or (at your option) any later version. This is online at: * 00014 * http://www.fsf.org/copyleft/gpl.html * 00015 * Please send any updates to: fred@gruntose.com * 00016 \*****************************************************************************/ 00017 00018 #include "definitions.h" 00019 00020 /* @file utility.h 00021 A collection of useful functions for checksums, timestamps and such. 00022 */ 00023 00025 00026 namespace utility { 00027 00028 istring timestamp(bool add_space = false, bool add_date = false); 00030 00034 byte byte_checksum(const byte *data, int length); 00036 u_int short_checksum(const byte *data, int length); 00038 00039 uint16 fletcher_checksum(const byte *data, int length); 00041 00042 uint16 rolling_fletcher_checksum(uint16 previous, const byte *data, int len); 00044 00051 unsigned int bizarre_checksum(const byte *data, int length); 00053 00055 u_int hash_bytes(const void *key_data, int key_length); 00057 00060 } // utility namespace. 00061 00062 //hmmm: deprecated. 00063 istring timestamp(bool add_space = false, bool add_date = false); 00065 00066 #endif // outer guard. 00067
1.5.1