aboutsummaryrefslogtreecommitdiff
path: root/dep/g3dlite/G3D/uint128.h
blob: da1af3ec2728c1d911421a3d00dcd056ad9d671f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/**
 @file uint128.h
 
 @maintainer Morgan McGuire, http://graphics.cs.williams.edu
 @author Kyle Whitson
 
 @created 2008-07-17
 @edited  2008-07-17
 */

#ifndef G3D_UINT128_H
#define G3D_UINT128_H

#include "G3D/g3dmath.h"

namespace G3D {

/** Limited functionality 128-bit unsigned integer. This is primarily to support FNV hashing and other
    cryptography applications.  See the GMP library for high-precision C++ math support. */
class uint128 {
public:

	G3D::uint64 hi;
	G3D::uint64 lo;

    uint128(const uint64& lo);

	uint128(const uint64& hi, const uint64& lo);

	uint128& operator+=(const uint128& x);

	uint128& operator*=(const uint128& x);

	uint128& operator^=(const uint128& x);

	uint128& operator&=(const uint128& x);

	uint128& operator|=(const uint128& x);

	bool operator==(const uint128& x);

    uint128& operator>>=(const int x);

    uint128& operator<<=(const int x);

    uint128 operator&(const uint128& x);

};
}

#endif