Index: trunk/phase3/includes/HistoryBlob.php |
— | — | @@ -567,10 +567,11 @@ |
568 | 568 | function xdiffAdler32( $s ) { |
569 | 569 | static $init; |
570 | 570 | if ( $init === null ) { |
571 | | - // The real Adler-32 checksum of this string is zero, so it |
572 | | - // initialises the state to the LibXDiff initial value. |
573 | 571 | $init = str_repeat( "\xf0", 205 ) . "\xee" . str_repeat( "\xf0", 67 ) . "\x02"; |
574 | 572 | } |
| 573 | + // The real Adler-32 checksum of $init is zero, so it initialises the |
| 574 | + // state to zero, as it is at the start of LibXDiff's checksum |
| 575 | + // algorithm. Appending the subject string then simulates LibXDiff. |
575 | 576 | if ( function_exists( 'hash' ) ) { |
576 | 577 | $hash = hash( 'adler32', $init . $s, true ); |
577 | 578 | } elseif ( function_exists( 'mhash' ) ) { |