468,484 Members | 1,757 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,484 developers. It's quick & easy.

Hash key for vector of 3 ints


Hi all,
I'm currently creating my hash key by stuffing the bits into an
unsigned long long.

key = static_cast<uint64>(x) | (static_cast<uint64>(y) << 20) |
(static_cast<uint64>(z) << 40);

But this limits the range in x,y,z.

I've made a few attempts in Visual Studio including making an XOR of
the vector ints.
I don't think the XOR gives keys that are unique enough.

error C2440: 'type cast' : cannot convert from 'const vector3i' to
'size_t' c:\program files\microsoft visual studio 8\vc\include
\xhash
Anyone have an example or hints?
thanks

Apr 9 '08 #1
0 1001

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Murali | last post: by
9 posts views Thread by Jeff | last post: by
2 posts views Thread by foxx | last post: by
13 posts views Thread by smp | last post: by
2 posts views Thread by Markus Dehmann | last post: by
42 posts views Thread by barcaroller | last post: by
2 posts views Thread by gieforce | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.