Created
July 15, 2013 02:14
-
-
Save 0xa/5997069 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace Kademlia { | |
template<int _Size, class _Parent> | |
struct ID { | |
char data[_Size]; | |
inline _Parent operator^(ID y) { | |
_Parent result; | |
int i; | |
for (i=0; i<_Size; i++) { | |
result.data[i] = data[i] ^ y.data[i]; | |
} | |
return result; | |
} | |
}; | |
struct Key : public ID<160/8, Key> {}; | |
struct NodeID : public ID<160/8, NodeID> {}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment