hash.js 280 B

1234567891011
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.hash = void 0;
  4. const hash = (str) => {
  5. let hash = 5381;
  6. let i = str.length;
  7. while (i)
  8. hash = (hash * 33) ^ str.charCodeAt(--i);
  9. return hash >>> 0;
  10. };
  11. exports.hash = hash;