const m = 0x5bd1e995 ; const encoder = new TextEncoder ( ) ; param str param seed returns export function murmur2 ( str , seed ) { const data = encoder . encode ( str ) ; let len = data . length ; let h = seed ^ len ; let i = 0 ; while ( len >= 4 ) { let k = ( data [ i ] & 0xff ) | ( ( data [ ++ i ] & 0xff ) << 8 ) | ( ( data [ ++ i ] & 0xff ) << 16 ) | ( ( data [ ++ i ] & 0xff ) << 24 ) ; k = ( k & 0xffff ) * m + ( ( ( ( k >>> 16 ) * m ) & 0xffff ) << 16 ) ; k ^= k >>> 24 ; k = ( k & 0xffff ) * m + ( ( ( ( k >>> 16 ) * m ) & 0xffff ) << 16 ) ; h = ( ( h & 0xffff ) * m + ( ( ( ( h >>> 16 ) * m ) & 0xffff ) << 16 ) ) ^ k ; len -= 4 ; ++ i ; } switch ( len ) { case 3 : h ^= ( data [ i + 2 ] & 0xff ) << 16 ; case 2 : h ^= ( data [ i + 1 ] & 0xff ) << 8 ; case 1 : h ^= data [ i ] & 0xff ; h = ( h & 0xffff ) * m + ( ( ( ( h >>> 16 ) * m ) & 0xffff ) << 16 ) ; } h ^= h >>> 13 ; h = ( h & 0xffff ) * m + ( ( ( ( h >>> 16 ) * m ) & 0xffff ) << 16 ) ; h ^= h >>> 15 ; return h >>> 0 ; }