CollisionDJBX implements CollisionInterface { public int hashForth( String s ) { byte[] byteArray = s.getBytes( Charset.defaultCharset() ); int n = byteArray.length; int key = 0; for ( int i = 0; i < n; i++ ) { int h = key; key = key << 10; for ( int ab = 0; ab < 6; ab++ ) { key = ( key << 1 ) + h; } key = key + byteArray[i]; } return key; }  int getLengthString(); void setLengthString( int lengthString ); int getLengthSuffix(); void setLengthSuffix( int lengthSuffix ); @Override int getHash( String s ); int hashForth( String s ); int hashBack( String s, int target ); @Override void genNCollisions( int numberAttributes, StringBuilder sb, boolean useNamespace ); @Override String getCollisionString( int i, int n ); Set<String> generateCollionsMeetInTheMiddle( long numberCollisions ); String getIthNCharString( int i, int n );  }
@Test public void hashForthTest() { assertThat( collisionDJBX.hashForth( "0" ), is( 48 ) ); assertThat( collisionDJBX.hashForth( "abc" ), is( 807794786 ) ); }