1 2 3 4 5 6 7 8 9 10 | function _uHash(d) { if (!d || d=="") return 1; var h=0,g=0; for (var i=d.length-1;i>=0;i--) { var c=parseInt(d.charCodeAt(i)); h=((h << 6) & 0xfffffff) + c + (c << 14); if ((g=h & 0xfe00000)!=0) h=(h ^ (g >> 21)); } return h; } |
Direct link: https://paste.plurk.com/show/v2Viksrd43ARj2ZZ0Iac