Beispiel #1
0
def test_null_key():
    h0 = _pybloof.hash('foo')
    h1 = _pybloof.hash('foo\0bar')
    h2 = _pybloof.hash('foo\0baz')
    assert h0 != h1, 'Hash collision for appended null'
    assert h0 != h2, 'Hash collision for appended null'
    assert h1 != h2, 'Hash collision for bytes after null'
Beispiel #2
0
def test_null_key():
    h0 = _pybloof.hash('foo')
    h1 = _pybloof.hash('foo\0bar')
    h2 = _pybloof.hash('foo\0baz')
    assert h0 != h1, 'Hash collision for appended null'
    assert h0 != h2, 'Hash collision for appended null'
    assert h1 != h2, 'Hash collision for bytes after null'
Beispiel #3
0
def test__mhash3():
    h1 = _pybloof.hash('foo')
    h2 = _pybloof.hash('foo', h1 & 0xFFFFFFFF)
    print h1, h2
    assert (-39287385592190013122878999397579195001,
            -73964642705803263641983394469427790275) == (h1, h2)
Beispiel #4
0
def test__mhash3():
    h1 = _pybloof.hash('foo')
    h2 = _pybloof.hash('foo', h1 & 0xFFFFFFFF)
    assert (-39287385592190013122878999397579195001,
            -73964642705803263641983394469427790275) == (h1, h2)