This test was failing because the hash computes values greater than 0x7fffffff, which 32-bit python2 promotes to long, which `hex` formats with a trailing 'L'. The code that uses it appears to be ok with a long value, so it's just the test that needs to handle it. Fix as suggested here: https://stackoverflow.com/questions/5917203/python-trailing-l-problem