Newton Dynamics  4.00
ndCRC.h
1 /* Copyright (c) <2003-2022> <Newton Game Dynamics>
2 *
3 * This software is provided 'as-is', without any express or implied
4 * warranty. In no event will the authors be held liable for any damages
5 * arising from the use of this software.
6 *
7 * Permission is granted to anyone to use this software for any purpose,
8 * including commercial applications, and to alter it and redistribute it
9 * freely
10 */
11 
12 #ifndef __NDCRC_H__
13 #define __NDCRC_H__
14 
15 #include "ndCoreStdafx.h"
16 
17 D_CORE_API ndUnsigned64 dCRC64 (const char* const string, ndUnsigned64 crcAcc = 0);
18 D_CORE_API ndUnsigned64 dCRC64 (const void* const buffer, ndInt32 size, ndUnsigned64 crcAcc);
19 
20 inline ndUnsigned64 dCombineCRC(ndUnsigned64 a, ndUnsigned64 b)
21 {
22  return (a << 8) ^ b;
23 }
24 
25 
26 #endif
27