source: trip-planner-front/node_modules/unique-slug/index.js@ 76712b2

Last change on this file since 76712b2 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 287 bytes
Line 
1'use strict'
2var MurmurHash3 = require('imurmurhash')
3
4module.exports = function (uniq) {
5 if (uniq) {
6 var hash = new MurmurHash3(uniq)
7 return ('00000000' + hash.result().toString(16)).substr(-8)
8 } else {
9 return (Math.random().toString(16) + '0000000').substr(2, 8)
10 }
11}
Note: See TracBrowser for help on using the repository browser.