Simple Hash Collisions in Lua
Related
More from Kate Murphy
Note: This is all Python 3 code. Other versions of Python may handle subprocesses and bytearrays differently. A Git bomb is a compact repository that explodes to consume extreme size on disk and in memory. Read more about them in the original git bomb post. This post walks through some code to create them. A full script to create them is...
If you are an adventurous sort (and can handle a potential reboot) I invite you to clone this tiny repo: $ git clone https://github.com/Katee/git-bomb.git Were you able to clone it? Unless you have quite a lot of memory (both RAM and storage) git was killed, ran out of memory, or you had to reboot. Why is this? It is a perfectly formed repo made...
Note: All code was run using Ruby MRI 2.4.1 and is not guaranteed to behave the same in other implementations (JRuby, mruby, etc). Also you probably don’t want to do this in a real project. Like (every?) user of Ruby I constantly use the built-in Hash class. I’ve made my own classes usable as keys and know that there are multiple equality...
This is a quick follow-up to Weird Python Integers. While writing that post, I saw some Python behaviour I didn’t understand. Then I read some comments by kmill and squeaky-clean in response to my original post, and now I can explain Python’s behaviour. If you don’t know about the “small integers” table in Python, I recommend reading the original...
Note: all of this code was run on my machine using Python 3.6.1. Not everything will work the same if you test using Python 2. >>> a = 42 >>> b = 42 >>> a is b True >>> a = 316 >>> b = 316 >>> a is b False That is suprising! It turns out that all “small integers” with the same value point to the same memory. We can use the Python built-in...