public int [ ] hash ( Key k ) { byte [ ] b = k . getBytes ( ) ; if ( b == null ) { throw new NullPointerException ( "buffer reference is null" ) ; } if ( b . length == 0 ) { throw new IllegalArgumentException ( "key length must be > 0" ) ; } int [ ] result = new int [ nbHash ] ; for ( int i = 0 , initval = 0 ; i < nbHash ; i ++ ) { initval = hashFunction . hash ( b , initval ) ; result [ i ] = Math . abs ( initval % maxValue ) ; } return result ; }
Hashes a specified key into several integers .