A datamosh is what happens when you put new data into a custom Hash structure that is designed to accommodate collisions by finding a new spot for old colliding data. You put in the new data, there's a collision, and your function attempts to do a secondary put on the discovered colliding data, but finds collision with that too and keeps trying and failing to put the data. Then, when the stack has almost completely unraveled and everything has been shifted, the original function tries to put the new data into its place again but discovers that the collision resolution algorithm put something else there. So it starts all over ...
>>2
I was just considering implementing this to fix dangling chains created by removes, but I decided to use tombstones instead. And you answered my question before my question was posted.
Name:
Anonymous2012-04-15 1:38
>>4
Hash tables are for PHP monkeys. Do it the Lisp way: use a linear search on a linked list.
>>7
Main difference being that it does the new data put before looking to resolve the collision, which seems much more practical. I can still see a badly implemented function using this kind of hash wasting all its time putting old data somewhere else in a well-packed table.
Name:
Anonymous2012-04-15 15:04
>>8
yeah, I did a quick implementation for fun, and it seemed to infinitely loop. But I may have missed a case, like what to do when two items hash exactly to the same slot. I guess that's where hashing multiple hash functions comes in.