0x100000000 = 2^32 = 4294967296. But the function returns 2^32 -1 = 4294967295 = 0xFFFFFFFF. So this definition is not correct.