js/calci.js
/**
 * B = Length of longest backwards repetition
 * O = Number of occurrences of longest backwards repetitions
 * D = Distance to previous instance of longest backwards repetition
 */
B = Length of longest backwards repetition
O = Number of occurrences of longest backwards repetitions
D = Distance to previous instance of longest backwards repetition
B = Length of longest backwards repetition O = Number of occurrences of longest backwards repetitions D = Distance to previous instance of longest backwards repetition
function bod(s, i) {
	var len = 0;
	var distance = 0;
	var occurrences = 1;
	if (i > 0){
		for(var j = i-1; j >= len-1; j--) {
			if (s.substr(j-len+1, len) != s.substr(i-len+1, len)){
				continue;
			}
			while (s.charAt(i-len) == s.charAt(j-len)){
				len++;
				occurrences = 1;
				distance = i - j;
			}
			if (len > 0){
				occurrences++;
			}
		}
	}
	return {
		b: len,
		o: occurrences,
		d: distance
	};
}
function bod ( s , i ) { var len = 0 ; var distance = 0 ; var occurrences = 1 ; if ( i > 0 ) { for ( var j = i - 1 ; j >= len - 1 ; j -- ) { if ( s . substr ( j - len + 1 , len ) != s . substr ( i - len + 1 , len ) ) { continue ; } while ( s . charAt ( i - len ) == s . charAt ( j - len ) ) { len ++ ; occurrences = 1 ; distance = i - j ; } if ( len > 0 ) { occurrences ++ ; } } } return { b : len , o : occurrences , d : distance } ; }
B = Length of longest backwards repetition
 O = Number of occurrences of longest backwards repetitions
 D = Distance to previous instance of longest backwards repetition
B = Length of longest backwards repetition O = Number of occurrences of longest backwards repetitions D = Distance to previous instance of longest backwards repetition