public static <K>byte[] generate(Set<K> set,UniversalHash<K> hash){
  ArrayList<K> list=new ArrayList<K>();
  list.addAll(set);
  ByteArrayOutputStream out=new ByteArrayOutputStream();
  int seed=RANDOM.nextInt();
  out.write(seed >>> 24);
  out.write(seed >>> 16);
  out.write(seed >>> 8);
  out.write(seed);
  generate(list,hash,0,seed,out);
  return compress(out.toByteArray());
}

public static < K > byte [ ] generate ( Set < K > set , UniversalHash < K > hash ) { ArrayList < K > list = new ArrayList < K > ( ) ; list . addAll ( set ) ; ByteArrayOutputStream out = new ByteArrayOutputStream ( ) ; int seed = RANDOM . nextInt ( ) ; out . write ( seed > > > 24 ) ; out . write ( seed > > > 16 ) ; out . write ( seed > > > 8 ) ; out . write ( seed ) ; generate ( list , hash , 0 , seed , out ) ; return compress ( out . toByteArray ( ) ) ; }
generate the minimal perfect hash function data from the given set of integers .
