66 #ifndef _OD_FNV1HASH_H_
67 #define _OD_FNV1HASH_H_
92 #if defined(NO_FNV_GCC_OPTIMIZATION)
95 hval += (hval << 1) + (hval << 4) + (hval << 7) +
96 (hval << 8) + (hval << 24);
124 #if defined(NO_FNV_GCC_OPTIMIZATION)
127 hval += (hval << 1) + (hval << 4) + (hval << 7) +
128 (hval << 8) + (hval << 24);
159 #if defined(NO_FNV_GCC_OPTIMIZATION)
162 hval += (hval << 1) + (hval << 4) + (hval << 7) +
163 (hval << 8) + (hval << 24);
190 #if defined(NO_FNV_GCC_OPTIMIZATION)
193 hval += (hval << 1) + (hval << 4) + (hval << 7) +
194 (hval << 8) + (hval << 24);
222 #if defined(NO_FNV_GCC_OPTIMIZATION)
223 hval *= 0x100000001b3;
225 hval += (hval << 1) + (hval << 4) + (hval << 5) +
226 (hval << 7) + (hval << 8) + (hval << 40);
254 #if defined(NO_FNV_GCC_OPTIMIZATION)
255 hval *= 0x100000001b3;
257 hval += (hval << 1) + (hval << 4) + (hval << 5) +
258 (hval << 7) + (hval << 8) + (hval << 40);
289 #if defined(NO_FNV_GCC_OPTIMIZATION)
290 hval *= 0x100000001b3;
292 hval += (hval << 1) + (hval << 4) + (hval << 5) +
293 (hval << 7) + (hval << 8) + (hval << 40);
320 #if defined(NO_FNV_GCC_OPTIMIZATION)
321 hval *= 0x100000001b3;
323 hval += (hval << 1) + (hval << 4) + (hval << 5) +
324 (hval << 7) + (hval << 8) + (hval << 40);
333 template <
typename Type,
size_t szf = sizeof(Type)>
335 template <
typename Type>
350 template <
typename DataType>
352 template <
typename DataType>
355 template <
typename DataType>
356 static inline Type tArray(
const DataType *pData,
size_t nVals) {
return buf(pData,
sizeof(DataType) * nVals); }
357 template <
typename DataType>
358 static inline Type tArray(
const DataType *pData,
size_t nVals,
Type hval) {
return buf(pData,
sizeof(DataType) * nVals, hval); }
360 template <
typename ArrayType>
361 static inline Type odArray(
const ArrayType &arry) {
return tArray(arry.getPtr(), arry.size()); }
362 template <
typename ArrayType>
363 static inline Type odArray(
const ArrayType &arry,
Type hval) {
return tArray(arry.getPtr(), arry.size(), hval); }
365 template <
typename Type>
380 template <
typename DataType>
382 template <
typename DataType>
385 template <
typename DataType>
386 static inline Type tArray(
const DataType *pData,
size_t nVals) {
return buf(pData,
sizeof(DataType) * nVals); }
387 template <
typename DataType>
388 static inline Type tArray(
const DataType *pData,
size_t nVals,
Type hval) {
return buf(pData,
sizeof(DataType) * nVals, hval); }
390 template <
typename ArrayType>
391 static inline Type odArray(
const ArrayType &arry) {
return tArray(arry.getPtr(), arry.size()); }
392 template <
typename ArrayType>
393 static inline Type odArray(
const ArrayType &arry,
Type hval) {
return tArray(arry.getPtr(), arry.size(), hval); }
396 template <
typename Type,
size_t szf = sizeof(Type)>
398 template <
typename Type>
413 template <
typename DataType>
415 template <
typename DataType>
418 template <
typename DataType>
419 static inline Type tArray(
const DataType *pData,
size_t nVals) {
return buf(pData,
sizeof(DataType) * nVals); }
420 template <
typename DataType>
421 static inline Type tArray(
const DataType *pData,
size_t nVals,
Type hval) {
return buf(pData,
sizeof(DataType) * nVals, hval); }
423 template <
typename ArrayType>
424 static inline Type odArray(
const ArrayType &arry) {
return tArray(arry.getPtr(), arry.size()); }
425 template <
typename ArrayType>
426 static inline Type odArray(
const ArrayType &arry,
Type hval) {
return tArray(arry.getPtr(), arry.size(), hval); }
428 template <
typename Type>
443 template <
typename DataType>
445 template <
typename DataType>
448 template <
typename DataType>
449 static inline Type tArray(
const DataType *pData,
size_t nVals) {
return buf(pData,
sizeof(DataType) * nVals); }
450 template <
typename DataType>
451 static inline Type tArray(
const DataType *pData,
size_t nVals,
Type hval) {
return buf(pData,
sizeof(DataType) * nVals, hval); }
453 template <
typename ArrayType>
454 static inline Type odArray(
const ArrayType &arry) {
return tArray(arry.getPtr(), arry.size()); }
455 template <
typename ArrayType>
456 static inline Type odArray(
const ArrayType &arry,
Type hval) {
return tArray(arry.getPtr(), arry.size(), hval); }
OdUInt64 odFNV64aHashStr(const char *str, OdUInt64 hval=0xcbf29ce484222325ULL)
OdUInt32 odFNV32aHashBuf(const void *buf, size_t len, OdUInt32 hval=0x811c9dc5)
OdUInt32 odFNV32aHashStr(const char *str, OdUInt32 hval=0x811c9dc5)
OdUInt64 odFNV64HashBuf(const void *buf, size_t len, OdUInt64 hval=0xcbf29ce484222325ULL)
OdUInt64 odFNV64HashStr(const char *str, OdUInt64 hval=0xcbf29ce484222325ULL)
OdUInt64 odFNV64aHashBuf(const void *buf, size_t len, OdUInt64 hval=0xcbf29ce484222325ULL)
OdUInt32 odFNV32HashBuf(const void *buf, size_t len, OdUInt32 hval=0x811c9dc5)
OdUInt32 odFNV32HashStr(const char *str, OdUInt32 hval=0x811c9dc5)
static Type buf(const void *buf, size_t len)
static Type str(const char *str)
static Type tArray(const DataType *pData, size_t nVals)
static Type str(const OdChar *str)
static Type str(const OdString &str, Type hval)
static Type odArray(const ArrayType &arry)
static Type str(const OdString &str)
static Type str(const OdChar *str, Type hval)
static Type buf(const void *buf, size_t len, Type hval)
static Type tArray(const DataType *pData, size_t nVals, Type hval)
static Type str(const char *str, Type hval)
static Type type(DataType data)
static Type type(DataType data, Type hval)
static Type odArray(const ArrayType &arry, Type hval)
static Type tArray(const DataType *pData, size_t nVals, Type hval)
static Type str(const OdString &str, Type hval)
static Type str(const OdChar *str, Type hval)
static Type odArray(const ArrayType &arry, Type hval)
static Type str(const OdString &str)
static Type tArray(const DataType *pData, size_t nVals)
static Type str(const char *str, Type hval)
static Type str(const char *str)
static Type buf(const void *buf, size_t len, Type hval)
static Type odArray(const ArrayType &arry)
static Type buf(const void *buf, size_t len)
static Type str(const OdChar *str)
static Type type(DataType data)
static Type type(DataType data, Type hval)
static Type buf(const void *buf, size_t len)
static Type buf(const void *buf, size_t len, Type hval)
static Type type(DataType data, Type hval)
static Type type(DataType data)
static Type str(const char *str, Type hval)
static Type str(const OdString &str, Type hval)
static Type odArray(const ArrayType &arry)
static Type odArray(const ArrayType &arry, Type hval)
static Type str(const char *str)
static Type str(const OdChar *str, Type hval)
static Type str(const OdChar *str)
static Type tArray(const DataType *pData, size_t nVals, Type hval)
static Type tArray(const DataType *pData, size_t nVals)
static Type str(const OdString &str)
static Type str(const OdChar *str)
static Type str(const OdString &str)
static Type str(const OdString &str, Type hval)
static Type str(const char *str, Type hval)
static Type tArray(const DataType *pData, size_t nVals, Type hval)
static Type buf(const void *buf, size_t len, Type hval)
static Type buf(const void *buf, size_t len)
static Type tArray(const DataType *pData, size_t nVals)
static Type str(const OdChar *str, Type hval)
static Type str(const char *str)
static Type odArray(const ArrayType &arry)
static Type type(DataType data)
static Type odArray(const ArrayType &arry, Type hval)
static Type type(DataType data, Type hval)
const OdChar * c_str() const
GLint GLenum GLsizei GLsizei GLint GLsizei const void * data