

Breaking a Toy Hash Function - pizza
http://twistedoakstudios.com/blog/Post4706_breaking-a-toy-hash-function

======
gklitt
Fascinating writeup! I enjoy it when a writer thoroughly details an entire
thought process like this, instead of just focusing on the end result. This is
precisely the type of content that belongs on the HN front page.

~~~
jordan0day
This is also one of the first articles I've seen on hn in a while that had a
decent number of comments, all of which were fairly positive and/or
insightful.

------
pcwalton
"On the other hand, the equivalent imperative code is stupidly hard to get
right because you end up mixing everything together in a big jumble. (I spent
my time doing other things while the computer did the tedious work.)"

The PL geek in me really likes this nice demonstration of the power of higher
order functions, as opposed to C-style for loops, when it comes to getting
things done.

------
tomp
Wow! I've never before seen C# LINQ in action. I must say, it's amazing! I
hope more languages would adopt this.

~~~
tehwalrus
I vaguely remember LINQ from when I had a real job, but this is way cooler. I
just remembered it as chained function calls on a database query return (you
could do your filtering in C# instead of in the SQL) but this just looks like
SQL (or better - python) _in_ C#.

~~~
lucian1900
The syntax in the article desugars to the method calls you remember (which are
the common HOFs). Since the calls are lazy, they can also generate SQL when
asked to execute.

~~~
dashN9ne
I've not heard the term 'HOF' before and didn't find it/expand it with a
cursory search. Could you define/expand it?

~~~
lucian1900
I had (mistakenly) thought it's a commonly known term.

Wikipedia explains it better than I could
[http://en.wikipedia.org/wiki/Higher-
order_function](http://en.wikipedia.org/wiki/Higher-order_function)

------
GuiA
Brilliant. OP, thanks for writing; submitter, thanks for posting.

------
girvo
Seriously impressive write-up! I love it, and really want to have a go at
doing something like this myself. Where's the best place to start? I know a
_tiny_ bit about hashing functions, enough to know not to ever write one
myself... ;)

~~~
Strilanc
You might like the Matasano Crypto Challenge [1], or maybe just a coursera
course on crypto [2].

1: [http://www.matasano.com/articles/crypto-
challenges/](http://www.matasano.com/articles/crypto-challenges/) 2:
[https://www.coursera.org/course/crypto](https://www.coursera.org/course/crypto)

------
lccarrasco
This was really interesting to read, it also made me somewhat nostalgic since
I started programming "seriously" thanks to JASS, reading obfuscated JASS code
from DotA maps to answer questions in the official forums helped me make many
great friends, get a moderator position and collaborating in beta-testing,
great experience for my young years :).

------
tptacek
This is an excellent writeup. Break a crappy RNG next!

~~~
Strilanc
[http://xkcd.com/221/](http://xkcd.com/221/)

\- Can't be seeded.

\- Fails to use all possible outputs in range.

\- Causes philosophical thoughts.

~~~
FreakLegion
Never expected to run into anyone else from wc3c on HN. Salut!

~~~
Strilanc
Bonjour.

Ce n'est pas une grosse surprise de trouver des gens de wc3c sur HN parce que
les deux sont des communautés de programmeurs.

