random-uniq.js 213 B

12345678910111213
  1. "use strict";
  2. var generated = Object.create(null), random = Math.random;
  3. module.exports = function () {
  4. var str;
  5. do {
  6. str = random()
  7. .toString(36)
  8. .slice(2);
  9. } while (generated[str]);
  10. return str;
  11. };