00001 #ifndef DATAHASH_H 00002 #define DATAHASH_H 00003 00004 #include <QString> 00005 00006 /* 00007 00008 Idea for implementing changes in file data 00009 ------------------------------------------ 00010 by David 00011 00012 1. Need to tell DataHash which file version it is hashing before starting to hash. 00013 00014 2. hash(string, startValue) -> hash(fileVersion, string, startValue), called e.g.: 00015 { 00016 // this is stuff for the old file version 00017 hash(1, ownerName, startValue); 00018 hash(1, ownerEmail, startValue); 00019 00020 // here comes new stuff added in file version 2 00021 hash(2, ownerTel, startValue); 00022 } 00023 00024 hash() can then simply compare version numbers to determine whether to calculate hash or not. 00025 However, the order of hashing must still be kept. 00026 00027 */ 00028 00029 class DataHash 00030 { 00031 public: 00032 static void hash(const QString& string, unsigned int &startValue); 00033 static void hash(const void* data, unsigned int size, unsigned int &startValue); 00034 }; 00035 00036 #endif // DATAHASH_H