public void generateBinIds(HashEntry[] vec)

	{
	  int bucket = 0;
	  int bucketcnt = 0;
	  int i,bitsleft;
	  int curid;
	  int mask,val;
	  int hashbase = LSH_HASHBASE;

		for (i = 0; i < L; ++i) {
			curid = i;				// Tack-on bits that indicate the particular table this bin id belongs to
			bitsleft = k;
			do {
				if (bucketcnt == 0) {
					hashbase = (hashbase * HASH_MULTIPLIER) + HASH_ADDEND;
					bucket = hash16DotProduct(bucket, vec, hashbase);
					bucketcnt += 16;
				}
				if (bucketcnt >= bitsleft) {
					curid <<= bitsleft;
					mask = 1;
					mask = (mask << bitsleft) - 1;
					val = bucket >>> (bucketcnt - bitsleft);
					curid |= (val & mask);
					bucketcnt -= bitsleft;
					bitsleft = 0;
				} else {
					curid <<= bucketcnt;
					mask = 1;
					mask = (mask << bucketcnt) - 1;
					curid |= (bucket & mask);
					bitsleft -= bucketcnt;
					bucketcnt = 0;
				}
			} while (bitsleft > 0);
			char[] token = tokenList[i].buffer;
			for(int j=0;j<token.length;++j) {
				token[j] = Base64Lite.encode[curid & 0x3f];		// encode 6 bits
				curid >>= 6;												// move to next 6 bits
			}
		}
	}
Generate a dot product of the hash vector in -vec- with a random family of 16 vectors, { r }
r_0 is a randomly generated set of +1 -1 coefficients across all the dimensions (indexed by uint32 vec[i].hash)
  The coefficient is calculated as a hashing function from the seed -hashcur- and the index (vec[i].hash),
  so it should be balanced between +1 and -1.
All the other vectors are generated from an FFT of r_0.  This allows the dotproduct with vec to be calculated
  using an FFT if -vec- has many non-zero coefficients.  If -vec- has only a few non-zero coefficients,
  the dotproduct if calculated with each vector in the family directly for better efficiency.
The resulting dotproducts are converted into a 16-long bitvector based on the sign of the dotproduct and
  placed in -bucket-
@param bucket is the (possibly partially filled) accumulator for dotproduct bits
@param vec is the HashEntry vector to calculate the dot-products on
@param hashcur is the index of the hash subfamily to representing r_0
@param res is space (a 16-long double array) for the in-place FFT
@return the bucket with new accumulated dot-product bits
Ghidra/Extensions/BSimElasticPlugin/src/org/elasticsearch/plugin/analysis/lsh/LSHBinner.java