hash.js 245 B

123456789101112
  1. 'use strict';
  2. const murmur = require('imurmurhash');
  3. /**
  4. * hash the given string
  5. * @param {string} str the string to hash
  6. * @returns {string} the hash
  7. */
  8. module.exports = function hash(str) {
  9. return murmur(str).result().toString(36);
  10. };