public static function hashEquals( $known, $input ) {
		if ( !is_string( $known ) ) {
			return false;
		}
		if ( !is_string( $input ) ) {
			return false;
		}

		if ( function_exists( 'hash_equals' ) ) {
			return hash_equals( $known, $input );

		} else {
			// hash_equals() polyfill taken from MediaWiki
			$len = strlen( $known );
			if ( $len !== strlen( $input ) ) {
				return false;
			}

			$result = 0;
			for ( $i = 0; $i < $len; $i++ ) {
				$result |= ord( $known[$i] ) ^ ord( $input[$i] );
			}

			return $result === 0;
		}
	}