Cryptographic hash golf (robbers) This contest is over.
  
  There are no remaining crackable answer in the cops challenge.


Companion thread of Cryptographic hash golf

As a reminder, here are the rules for robbers from the main challenge:


  Task
  
  Crack any of the cops' submissions by posting the following in the
  robbers' thread: two messages M and N in I such that
  H(M) = H(N) and M ≠ N.
  
  Scoring
  
  Cracking each cop submissions gains you one point. The robber with the most points wins.
  
  In the case of a tie, the tied robber that cracked the longest
  submission wins.
  
  Additional rules
  
  
  Every cop submission can only be cracked once.
  If a cop submission relies on implementation-defined or undefined behavior, you only have to find a crack that works (verifiably) on
  your machine.
  Each crack belongs to a separate answer in the robbers' thread.
  Posting an invalid cracking attempt bans you from cracking that particular submission for 30 minutes.
  You may not crack your own submission.
  
  
  Example
  
  
    Python 2.7, 22 bytes by user8675309

1

    
    and

18

  


Leaderboard


eBusiness: 3 cracks, 393 bytes
Martin Büttner: 3 cracks, 299 bytes
jimmy23013: 3 cracks, 161 bytes
Sp3000: 3 cracks, 44 bytes
tucuxi: 2 cracks, 239 bytes
Vi.: 2 cracks, 87 bytes
feersum: 1 crack, 216 bytes
mathmandan: 1 crack, 139 bytes
squeamish ossifrage: 1 crack, 134 bytes
Python, 109 bytes by Sp3000
Note that Martin cracked first, so I'm not sure if this deserves points. On the other hand, I did make a preimage attack rather than a simple collision - a much stronger result. This means that you can give it an arbitrary hash value, and it will construct an input that generates that hash value.
M = 2**128

# The hash to crack.
def jenkins(n):
    h = 42
    while n:
        h += n &amp; (M - 1)
        n &gt;&gt;= 128
        h *= 1025
        h ^= h &gt;&gt; 6
        h %= M

    h *= 9
    h ^= h &gt;&gt; 11
    h *= 32769

    return h % M

def egcd(a, b):
    if a == 0:
        return (b, 0, 1)
    else:
        g, y, x = egcd(b % a, a)
        return (g, x - (b // a) * y, y)

def modinv(a, m):
    g, x, y = egcd(a, m)
    if g != 1:
        raise Exception('modular inverse does not exist')
    else:
        return x % m

def invxorshift(h, s):
    r = h &gt;&gt; s
    while r:
        h ^= r
        r &gt;&gt;= s
    return h

def moddiv(a, b):
    return (a * modinv(b, M)) % M

def jenkins_crack(h):
    h = moddiv(h, 32769)
    h = invxorshift(h, 11)
    h = moddiv(h, 9)
    h = invxorshift(h, 6)
    h = moddiv(h, 1025)
    h -= 42
    return h

And to show that it works:
&gt;&gt;&gt; from crack import *
&gt;&gt;&gt; n = 2**128 + 1337
&gt;&gt;&gt; h = jenkins(n)
&gt;&gt;&gt; n2 = jenkins_crack(h)
&gt;&gt;&gt; h2 = jenkins(n2)
&gt;&gt;&gt; n != n2
True
&gt;&gt;&gt; h == h2
True

And to give a particular set of numbers that collide:
N: 2**128
M: 43617