Source: utils/hashkey.js

var _ = require('lodash'),
  hidden = '__hashkey__';

/**
 * @name hashkey
 * @param  {[type]} obj [description]
 * @return {[type]}     [description]
 */
module.exports = function (obj) {
  var uniqueId = obj;
  if (obj && (typeof obj === 'function' || typeof obj === 'object')) {
    if (!obj.hasOwnProperty(hidden)) {
      Object.defineProperty(obj, hidden, {
        value: _.uniqueId()
      });
    }
    uniqueId = obj[hidden];
  }
  return typeof obj + '-' + uniqueId;
};