nl_tokens: / * hash : function ( s ) { using Java s hash method ( except on empty string ) var hash = 0 i l char ; if ( s . length == 0 ) return 1 ; for ( i = 0 l = s . length ; i < l ; i ++ ) { char = s . charCodeAt ( i ) ; hash = (( hash << 5 ) - hash ) + char ; hash | = 0 ; // Convert to 32bit integer } return hash ;
pl_tokens: function ( str ) { var inhash = 0 ; var charcount = 0 ; var <mask> ; if ( str . length == 0 ) return 1 ; // if word is null, return 1 as hash value else for ( var i = 0 ; i < str . length ; i ++ ) { char = str . charCodeAt ( i ) ; inhash = ( ( inhash << 7 ) | ( inhash >>> 25 ) ) ^ char ; // xor into the rotateleft(7) of inhash inhash >>>= 0 ; // Convert to 32bit unsigned integer } return inhash ; }