66#ifndef _OD_FNV1HASH_H_
67#define _OD_FNV1HASH_H_
94#if defined(NO_FNV_GCC_OPTIMIZATION)
97 hval += (hval << 1) + (hval << 4) + (hval << 7) +
98 (hval << 8) + (hval << 24);
126#if defined(NO_FNV_GCC_OPTIMIZATION)
129 hval += (hval << 1) + (hval << 4) + (hval << 7) +
130 (hval << 8) + (hval << 24);
161#if defined(NO_FNV_GCC_OPTIMIZATION)
164 hval += (hval << 1) + (hval << 4) + (hval << 7) +
165 (hval << 8) + (hval << 24);
192#if defined(NO_FNV_GCC_OPTIMIZATION)
195 hval += (hval << 1) + (hval << 4) + (hval << 7) +
196 (hval << 8) + (hval << 24);
224#if defined(NO_FNV_GCC_OPTIMIZATION)
225 hval *= 0x100000001b3;
227 hval += (hval << 1) + (hval << 4) + (hval << 5) +
228 (hval << 7) + (hval << 8) + (hval << 40);
256#if defined(NO_FNV_GCC_OPTIMIZATION)
257 hval *= 0x100000001b3;
259 hval += (hval << 1) + (hval << 4) + (hval << 5) +
260 (hval << 7) + (hval << 8) + (hval << 40);
291#if defined(NO_FNV_GCC_OPTIMIZATION)
292 hval *= 0x100000001b3;
294 hval += (hval << 1) + (hval << 4) + (hval << 5) +
295 (hval << 7) + (hval << 8) + (hval << 40);
322#if defined(NO_FNV_GCC_OPTIMIZATION)
323 hval *= 0x100000001b3;
325 hval += (hval << 1) + (hval << 4) + (hval << 5) +
326 (hval << 7) + (hval << 8) + (hval << 40);
335template <
typename Type,
size_t szf = sizeof(Type)>
337template <
typename Type>
352 template <
typename DataType>
353 static inline Type
type(DataType
data) {
return buf(&
data,
sizeof(DataType)); }
354 template <
typename DataType>
355 static inline Type
type(DataType
data, Type hval) {
return buf(&
data,
sizeof(DataType), hval); }
357 template <
typename DataType>
358 static inline Type
tArray(
const DataType *pData,
size_t nVals) {
return buf(pData,
sizeof(DataType) * nVals); }
359 template <
typename DataType>
360 static inline Type
tArray(
const DataType *pData,
size_t nVals, Type hval) {
return buf(pData,
sizeof(DataType) * nVals, hval); }
362 template <
typename ArrayType>
363 static inline Type
odArray(
const ArrayType &arry) {
return tArray(arry.getPtr(), arry.size()); }
364 template <
typename ArrayType>
365 static inline Type
odArray(
const ArrayType &arry, Type hval) {
return tArray(arry.getPtr(), arry.size(), hval); }
367template <
typename Type>
382 template <
typename DataType>
383 static inline Type
type(DataType
data) {
return buf(&
data,
sizeof(DataType)); }
384 template <
typename DataType>
385 static inline Type
type(DataType
data, Type hval) {
return buf(&
data,
sizeof(DataType), hval); }
387 template <
typename DataType>
388 static inline Type
tArray(
const DataType *pData,
size_t nVals) {
return buf(pData,
sizeof(DataType) * nVals); }
389 template <
typename DataType>
390 static inline Type
tArray(
const DataType *pData,
size_t nVals, Type hval) {
return buf(pData,
sizeof(DataType) * nVals, hval); }
392 template <
typename ArrayType>
393 static inline Type
odArray(
const ArrayType &arry) {
return tArray(arry.getPtr(), arry.size()); }
394 template <
typename ArrayType>
395 static inline Type
odArray(
const ArrayType &arry, Type hval) {
return tArray(arry.getPtr(), arry.size(), hval); }
398template <
typename Type,
size_t szf = sizeof(Type)>
400template <
typename Type>
415 template <
typename DataType>
416 static inline Type
type(DataType
data) {
return buf(&
data,
sizeof(DataType)); }
417 template <
typename DataType>
418 static inline Type
type(DataType
data, Type hval) {
return buf(&
data,
sizeof(DataType), hval); }
420 template <
typename DataType>
421 static inline Type
tArray(
const DataType *pData,
size_t nVals) {
return buf(pData,
sizeof(DataType) * nVals); }
422 template <
typename DataType>
423 static inline Type
tArray(
const DataType *pData,
size_t nVals, Type hval) {
return buf(pData,
sizeof(DataType) * nVals, hval); }
425 template <
typename ArrayType>
426 static inline Type
odArray(
const ArrayType &arry) {
return tArray(arry.getPtr(), arry.size()); }
427 template <
typename ArrayType>
428 static inline Type
odArray(
const ArrayType &arry, Type hval) {
return tArray(arry.getPtr(), arry.size(), hval); }
430template <
typename Type>
445 template <
typename DataType>
446 static inline Type
type(DataType
data) {
return buf(&
data,
sizeof(DataType)); }
447 template <
typename DataType>
448 static inline Type
type(DataType
data, Type hval) {
return buf(&
data,
sizeof(DataType), hval); }
450 template <
typename DataType>
451 static inline Type
tArray(
const DataType *pData,
size_t nVals) {
return buf(pData,
sizeof(DataType) * nVals); }
452 template <
typename DataType>
453 static inline Type
tArray(
const DataType *pData,
size_t nVals, Type hval) {
return buf(pData,
sizeof(DataType) * nVals, hval); }
455 template <
typename ArrayType>
456 static inline Type
odArray(
const ArrayType &arry) {
return tArray(arry.getPtr(), arry.size()); }
457 template <
typename ArrayType>
458 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