A probabilistic, super-duper memory efficient hash “set,” used primarily for short-circuiting otherwise expensive computations
Find results are only “definitely not” and “maybe”
Supports find and insert operations only—no actual data elements is stored (since, as the NSA informed us, metadata is not real data! 😉 ), so there’s such thing as a “get” op
This is especially useful for privacy purposes
How it works
On insert, take K (fast) hash functions, each hash function sets one bit in the Bloom filter’s bit field
On find, hash the object and see if each of the bits you get from your hash functions are set; if they are, the item in question was probably inserted in the past
Increasing the number of hash functions decreases your false positive probability (but increases the memory usage)
Representation of a search space (used for pathfinding) that reduces the number of nodes necessary to represent the traversable area
Grid representations suck: They don’t map well onto non-square shapes, and you typically use a lot of them
Triangle nav meshes improve upon this; using a mix of triangles and squares can improve it even further
Consider:
To actually traverse this, you would move from edge to edge to get between nodes, and when you reach your destination node, you could simply beeline to your goal (since you know it will be free of obstacles)
You can use Recast to create nav meshes, and A* or the like to search them
A combination of a pointer and a hash of the thing being pointed to
Allows you to verify that the data hasn’t been changed since you got the pointer to it
Most common implementation is in Merkle trees in cryptocurrency blockchains
Tamper detection: suppose the data in a block has changed maliciously in a blockchain (a series of hash pointers + data). In order for the attacker to “get away with it,” they’ll have to change the data in Block X, plus the hash in Block Y that points to Block X. But, Block Z stored a hashpointer to Block X as well, and its hash included the now-altered hash in Block X, so the attacker has to also change the hash of Block Z (and so on up the chain).
Verification is O(N), for N number of blocks
Alternative: Merkle trees
Tree structure where only the leaves hold data, and all other nodes simply store 2 hash pointers to 2 children
Verification of the structure takes O(log(N)) time, but that also means it takes less tampering on the part of an attacker