11cb0ef41Sopenharmony_ci'use strict' 21cb0ef41Sopenharmony_civar MurmurHash3 = require('imurmurhash') 31cb0ef41Sopenharmony_ci 41cb0ef41Sopenharmony_cimodule.exports = function (uniq) { 51cb0ef41Sopenharmony_ci if (uniq) { 61cb0ef41Sopenharmony_ci var hash = new MurmurHash3(uniq) 71cb0ef41Sopenharmony_ci return ('00000000' + hash.result().toString(16)).slice(-8) 81cb0ef41Sopenharmony_ci } else { 91cb0ef41Sopenharmony_ci return (Math.random().toString(16) + '0000000').slice(2, 10) 101cb0ef41Sopenharmony_ci } 111cb0ef41Sopenharmony_ci} 12