function hammingDistance( s1, s2 ) {
	var out;
	var i;

	if ( !isString( s1 ) ) {
		throw new TypeError( format( 'invalid argument. First argument must be a string. Value: `%s`.', s1 ) );
	}
	if ( !isString( s2 ) ) {
		throw new TypeError( format( 'invalid argument. Second argument must be a string. Value: `%s`.', s2 ) );
	}
	if ( s1.length !== s2.length ) {
		return -1;
	}
	out = 0;
	for ( i = 0; i < s1.length; i++ ) {
		if (s1[ i ] !== s2[ i ] ) {
			out += 1;
		}
	}
	return out;
}
Calculates the Hamming distance between two equal-length strings.

## Notes

-   The function returns a sentinel value of `-1` if the input string lengths differ.

@param {string} s1 - first input string
@param {string} s2 - second input string
@throws {TypeError} first argument must be a string
@throws {TypeError} second argument must be a string
@returns {integer} Hamming distance

@example
var distance = hammingDistance( 'algorithm', 'altruistic' );
// returns -1