Dashboard sipadu mbip
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

hash.browser.cjs.js 1.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. 'use strict';
  2. Object.defineProperty(exports, '__esModule', { value: true });
  3. /* eslint-disable */
  4. // murmurhash2 via https://github.com/garycourt/murmurhash-js/blob/master/murmurhash2_gc.js
  5. function murmurhash2_32_gc(str) {
  6. var l = str.length,
  7. h = l ^ l,
  8. i = 0,
  9. k;
  10. while (l >= 4) {
  11. k = str.charCodeAt(i) & 0xff | (str.charCodeAt(++i) & 0xff) << 8 | (str.charCodeAt(++i) & 0xff) << 16 | (str.charCodeAt(++i) & 0xff) << 24;
  12. k = (k & 0xffff) * 0x5bd1e995 + (((k >>> 16) * 0x5bd1e995 & 0xffff) << 16);
  13. k ^= k >>> 24;
  14. k = (k & 0xffff) * 0x5bd1e995 + (((k >>> 16) * 0x5bd1e995 & 0xffff) << 16);
  15. h = (h & 0xffff) * 0x5bd1e995 + (((h >>> 16) * 0x5bd1e995 & 0xffff) << 16) ^ k;
  16. l -= 4;
  17. ++i;
  18. }
  19. switch (l) {
  20. case 3:
  21. h ^= (str.charCodeAt(i + 2) & 0xff) << 16;
  22. case 2:
  23. h ^= (str.charCodeAt(i + 1) & 0xff) << 8;
  24. case 1:
  25. h ^= str.charCodeAt(i) & 0xff;
  26. h = (h & 0xffff) * 0x5bd1e995 + (((h >>> 16) * 0x5bd1e995 & 0xffff) << 16);
  27. }
  28. h ^= h >>> 13;
  29. h = (h & 0xffff) * 0x5bd1e995 + (((h >>> 16) * 0x5bd1e995 & 0xffff) << 16);
  30. h ^= h >>> 15;
  31. return (h >>> 0).toString(36);
  32. }
  33. exports.default = murmurhash2_32_gc;