From e06ec920f7a5d784e674c4c4b4e6d1da3dc7391d Mon Sep 17 00:00:00 2001 From: Piotr Russ Date: Mon, 16 Nov 2020 00:10:28 +0100 Subject: api, login, auth --- node_modules/unique-slug/index.js | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 node_modules/unique-slug/index.js (limited to 'node_modules/unique-slug/index.js') diff --git a/node_modules/unique-slug/index.js b/node_modules/unique-slug/index.js new file mode 100644 index 0000000..fa4761a --- /dev/null +++ b/node_modules/unique-slug/index.js @@ -0,0 +1,11 @@ +'use strict' +var MurmurHash3 = require('imurmurhash') + +module.exports = function (uniq) { + if (uniq) { + var hash = new MurmurHash3(uniq) + return ('00000000' + hash.result().toString(16)).substr(-8) + } else { + return (Math.random().toString(16) + '0000000').substr(2, 8) + } +} -- cgit v1.2.3