def generate_hashes(peaks, fan_value=DEFAULT_FAN_VALUE):
 if PEAK_SORT:
  peaks.sort(key=itemgetter(1))
 for i in range(len(peaks)):
  for j in range(1, fan_value):
   if ((i + j) < len(peaks)):
    freq1 = peaks[i][IDX_FREQ_I]
    freq2 = peaks[(i + j)][IDX_FREQ_I]
    t1 = peaks[i][IDX_TIME_J]
    t2 = peaks[(i + j)][IDX_TIME_J]
    t_delta = (t2 - t1)
    if ((t_delta >= MIN_HASH_TIME_DELTA) and (t_delta <= MAX_HASH_TIME_DELTA)):
     h = hashlib.sha1(('%s|%s|%s' % (str(freq1), str(freq2), str(t_delta))))
     (yield (h.hexdigest()[0:FINGERPRINT_REDUCTION], t1))

def generate_hashes ( peaks , fan_value = DEFAULT_FAN_VALUE ) : if PEAK_SORT : peaks . sort ( key = itemgetter ( 1 ) ) for i in range ( len ( peaks ) ) : for j in range ( 1 , fan_value ) : if ( ( i + j ) < len ( peaks ) ) : freq1 = peaks [ i ] [ IDX_FREQ_I ] freq2 = peaks [ ( i + j ) ] [ IDX_FREQ_I ] t1 = peaks [ i ] [ IDX_TIME_J ] t2 = peaks [ ( i + j ) ] [ IDX_TIME_J ] t_delta = ( t2 - t1 ) if ( ( t_delta >= MIN_HASH_TIME_DELTA ) and ( t_delta <= MAX_HASH_TIME_DELTA ) ) : h = hashlib . sha1 ( ( '%s|%s|%s' % ( str ( freq1 ) , str ( freq2 ) , str ( t_delta ) ) ) ) ( yield ( h . hexdigest ( ) [ 0 : FINGERPRINT_REDUCTION ] , t1 ) )
hash list structure: sha1_hash[0:20] time_offset [ .