コード例 #1
0
 public static void TestCollision4(int x1, long y1, int z1)
 {
     EffectiveJavaHashCode o1 = new EffectiveJavaHashCode(1234, BitConverter.DoubleToInt64Bits(3.14159E123), 3141);
     EffectiveJavaHashCode o2 = new EffectiveJavaHashCode(x1, y1, z1);
     if (o1.GetHashCode() == o2.GetHashCode())
     {
         System.Console.Out.WriteLine("Solved hash collision 4");
     }
 }
コード例 #2
0
 public static void TestCollision2(long y1, int z1, long y2, int z2)
 {
     EffectiveJavaHashCode o1 = new EffectiveJavaHashCode(1, y1, z1);
     EffectiveJavaHashCode o2 = new EffectiveJavaHashCode(2, y2, z2);
     if (o1.GetHashCode() == o2.GetHashCode())
     {
         System.Console.Out.WriteLine("Solved hash collision 2");
     }
 }
コード例 #3
0
    public static void TestCollision5(long y1, int z1)
    {
        EffectiveJavaHashCode o1 = new EffectiveJavaHashCode(1234, BitConverter.DoubleToInt64Bits(3.14159E123), 3141);
        EffectiveJavaHashCode o2 = new EffectiveJavaHashCode(5678, y1, z1);

        if (o1.GetHashCode() == o2.GetHashCode())
        {
            System.Console.Out.WriteLine("Solved hash collision 5");
        }
    }
コード例 #4
0
    public static void TestCollision2(long y1, int z1, long y2, int z2)
    {
        EffectiveJavaHashCode o1 = new EffectiveJavaHashCode(1, y1, z1);
        EffectiveJavaHashCode o2 = new EffectiveJavaHashCode(2, y2, z2);

        if (o1.GetHashCode() == o2.GetHashCode())
        {
            System.Console.Out.WriteLine("Solved hash collision 2");
        }
    }
コード例 #5
0
 public static void TestCollision3(long y1, long y2)
 {
     // The hashes can collide only if the lower 5 bits of z1/z2 match
     EffectiveJavaHashCode o1 = new EffectiveJavaHashCode(1234, y1, 3141);
     EffectiveJavaHashCode o2 = new EffectiveJavaHashCode(5678, y2, 3141);
     if (o1.GetHashCode() == o2.GetHashCode())
     {
         System.Console.Out.WriteLine("Solved hash collision 3");
     }
 }
コード例 #6
0
    public static void TestCollision3(long y1, long y2)
    {
        // The hashes can collide only if the lower 5 bits of z1/z2 match
        EffectiveJavaHashCode o1 = new EffectiveJavaHashCode(1234, y1, 3141);
        EffectiveJavaHashCode o2 = new EffectiveJavaHashCode(5678, y2, 3141);

        if (o1.GetHashCode() == o2.GetHashCode())
        {
            System.Console.Out.WriteLine("Solved hash collision 3");
        }
    }