Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Hash functions:
- int Hash(byte[] bytes);
- int Hash_Add(int hash, byte add);
- int Hash_Remove(int hash, byte remove);
- // With variables:
- byte[] x;
- byte b;
- // Where & is binary concat
- // Such that:
- Hash(x & b) == Hash_Add(Hash(x), b)
- // String example:
- Hash("abcd") == Hash_Add(Hash("abc"), "d") // this is very normal for hash funtions
- // AND such that:
- Hash(x) == Hash_Remove(Hash(b & x), b) // notice the order of b and x
- // String example:
- Hash("bcd") == Hash_Remove(Hash("abcd"), "a")
- // Also, order is important. I.e.
- Hash(x & b) != Hash(b & x)
Advertisement
Add Comment
Please, Sign In to add comment