src/merkle-json.js
/* there needs to be support for Unicode here,
     * unless we pretend that we can redefine the MD-5
     * algorithm for multi-byte characters (perhaps
     * by adding every four 16-bit characters and
     * shortening the sum to 32 bits). Otherwise
     * I suggest performing MD-5 as if every character
     * was two bytes--e.g., 0040 0025 = @%--but then
     * how will an ordinary MD-5 sum be matched?
     * There is no way to standardize text to something
     * like UTF-8 before transformation; speed cost is
     * utterly prohibitive. The JavaScript standard
     * itself needs to look at this: it should start
     * providing access to strings as preformed UTF-8
     * 8-bit unsigned value arrays.
     **/
there needs to be support for Unicode here,
unless we pretend that we can redefine the MD-5
algorithm for multi-byte characters (perhaps
by adding every four 16-bit characters and
shortening the sum to 32 bits).
there needs to be support for Unicode here unless we pretend that we can redefine the MD - 5 algorithm for multi - byte characters ( perhaps by adding every four 16 - bit characters and shortening the sum to 32 bits ) .
function md5blk(s) { 
        var md5blks = [],
            i; 
        for (i = 0; i < 64; i += 4) {
            md5blks[i >> 2] = s.charCodeAt(i) +
                (s.charCodeAt(i + 1) << 8) +
                (s.charCodeAt(i + 2) << 16) +
                (s.charCodeAt(i + 3) << 24);
        }
        return md5blks;
    }
function md5blk ( s ) { var md5blks = [ ] , i ; for ( i = 0 ; i < 64 ; i += 4 ) { md5blks [ i >> 2 ] = s . charCodeAt ( i ) + ( s . charCodeAt ( i + 1 ) << 8 ) + ( s . charCodeAt ( i + 2 ) << 16 ) + ( s . charCodeAt ( i + 3 ) << 24 ) ; } return md5blks ; }
there needs to be support for Unicode here,
 unless we pretend that we can redefine the MD-5
 algorithm for multi-byte characters (perhaps
 by adding every four 16-bit characters and
 shortening the sum to 32 bits).
there needs to be support for Unicode here unless we pretend that we can redefine the MD - 5 algorithm for multi - byte characters ( perhaps by adding every four 16 - bit characters and shortening the sum to 32 bits ) .
/* I figured global was faster.   */ /* Andy King said do it this way. */